RosettaCodeData/Task/XML-DOM-serialization/Python/xml-dom-serialization-2.py
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

5 lines
152 B
Python

from xml.etree import ElementTree as et
root = et.Element("root")
et.SubElement(root, "element").text = "Some text here"
xmlString = et.tostring(root)