I'm having a problem outputting even the simplest Element(Tree) instances. If I try the following code in Python 2.7.1
>>> from xml.etree.ElementTree import Element, SubElement, tostring
>>> root = Element('parent')
>>> child = Element('child')
>>> SubElement(root, child)
>>> tostring(root)
I get an error:
TypeError: cannot serialize <Element 'root' at 0x9a7c7ec> (type Element)
I must be doing something wrong but the documentation isn't pointing me at anything obvious.