def parse(self, xmlfile, **kwargs):
if PY3:
result = io.StringIO()
else:
result = io.BytesIO()
handler = XMLGenerator(result)
self.module.parse(xmlfile, handler, **kwargs)
return result.getvalue()