I have this code
root = etree.Element("root") root.append( etree.Element("child1") ) child2 = etree.SubElement(root, "child2") c