def _parse_from_source(self, source): from org.openxml.dom import SAXBuilder from org.openxml.parser import XMLSAXParser builder = SAXBuilder() parser = XMLSAXParser() parser.setDocumentHandler(builder) parser.parse(source) return Document(builder.getDocument())