element tree to string code example Example: 'xml.etree.ElementTree.Element' to string python xmlstr = ElementTree.tostring(et, encoding='utf8', method='xml')