Python: ElementTree XML element to string









import xml.etree.ElementTree as ET

# element is an xml.etree.ElementTree.Element object
xmlstr = ET.tostring(element, encoding='utf8', method='xml')


See also




No comments:

Post a Comment