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