Tengo un problema al generar incluso las instancias más simples de Element (Tree). Si intento el siguiente código en Python 2.7.1No se puede volcar o escribir un elemento ElementTree
>>> from xml.etree.ElementTree import Element, SubElement, tostring
>>> root = Element('parent')
>>> child = Element('child')
>>> SubElement(root, child)
>>> tostring(root)
consigo un error:
TypeError: cannot serialize <Element 'root' at 0x9a7c7ec> (type Element)
debo estar haciendo algo mal pero la documentación no me está apuntando a algo obvio.