I am current using ElementTree write a XML file
for i in range(len(lang_list)):
body = ET.SubElement(root, "body")
body.set("lang", lang_list[i])
# body.text = text_list[i] + " " + common_text
body.text =unescape(escape('<![CDATA[')) + text_list[i] + " " + common_text + unescape(escape(']]>'))
body.tail = "\n\t"
outpath = os.getcwd()
file = outpath + "\\test.xml"
tree.write(file, xml_declaration=True)
but there have a XML declaration, such as
DOCTYPE email-template PUBLIC "-//yourcompany, Inc.//DTD email-template//EN" "email-template.dtd">
How to write this information into the XML file?