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