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