import libxml2 class ContentHandler(object): def startDocument(self): pass def endDocument(self): pass def startElement(self, tag, attrs): print 'startElement', tag, attrs def endElement(self, tag): pass def characters(self, data): pass def warning(self, msg): pass def error(self, msg): pass def fatalError(self, msg): pass handler = ContentHandler() libxml2.SAXParseFile(handler, "cineguide.pack", 0)