Write xml file using lxml library in Python
- by systempuntoout
I'm using lxml to create an XML file from scratch;
having a code like this:
from lxml import etree
root = etree.Element("root")
root.set("interesting", "somewhat")
child1 = etree.SubElement(root, "test")
How do i write root Element object to an xml file using write() method of ElementTree class?