I am creating an xml
file, I just want that it should say this on the top
<?xml version="1.0" encoding="utf-8"?>
For now it says only
<?xml version="1.0" ?>
This is how I am creating it.
xmlstr = minidom.parseString(ET.tostring(root)).toprettyxml(indent=" ")
with open("Test.xml", "w", encoding='utf-8') as f:
f.write(xmlstr)