class StreamHandler(xml.sax.handler.ContentHandler):
    lastEntry = None
lastName = None

def startElement(self, name, attrs):
    self.lastName = name
if name == 'entry':
    self.lastEntry = {}
elif name != 'root':
    self.lastEntry[name] = {'attrs': attrs, 'content': ''}

def endElement(self, name):
    pass
What is a good XML stream parser for Python?