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