Mam problem z wyprowadzeniem nawet najprostszych instancji Element (Drzewo). Gdy próbuję następujący kod w Pythonie 2.7.1Nie można zrzucić lub napisać elementu ElementTree
>>> from xml.etree.ElementTree import Element, SubElement, tostring
>>> root = Element('parent')
>>> child = Element('child')
>>> SubElement(root, child)
>>> tostring(root)
pojawia się błąd:
TypeError: cannot serialize <Element 'root' at 0x9a7c7ec> (type Element)
muszę robić coś złego, ale dokumentacja nie jest skierowany do mnie na czymś oczywistym.