from xml.dom.minidom import parseString p=parseString("") print(p.toxml())