Howto create this XML string?
fredrik at pythonware.com
Fri Jan 20 11:11:40 EST 2006
> in the elementtree implementation the tostring function doesn't work with a
> tree, work only with an element. What is the way to put the tree in a
this is the code you posted:
root = ET.Element("manager")
... snip ...
tree = ET.ElementTree(root)
if you need the root variable instead of the tree variable, use root instead of tree.
or read the ET documentation; it explains how to get the root from a tree:
More information about the Python-list