Get string source of Python xml ElementTree
import xml.etree.ElementTree as ET
tree = ET.parse(source)
root = tree.getroot()
ET.tostring(root)
Note that there may be formatting differences between the content of source
and ET.tostring(doc)
.
import xml.etree.ElementTree as ET
tree = ET.parse(source)
root = tree.getroot()
ET.tostring(root)
Note that there may be formatting differences between the content of source
and ET.tostring(doc)
.