how to add <!DOCTYPE> to the starting of an xml file using python2.5? : <p>I have an xml file as follows:</p>

<pre><code> &lt;sample&gt;
  &lt;attributes&gt; xyz
  &lt;/attributes&gt;
  &lt;/sample&gt;
</code></pre>

<p>I want to add to the starting of xml:</p>

<pre><code> &lt;!DOCTYPE sample SYSTEM "location/sample.dtd"&gt;
</code></pre>

<p>I have to use python 2.5 only. So, can anybody please suggest how can i have this. I want final xml file to be:</p>

<pre><code> &lt;sample&gt;
  &lt;!DOCTYPE sample SYSTEM "location/sample.dtd"&gt;
  &lt;attributes&gt; xyz
  &lt;/attributes&gt;
  &lt;/sample&gt;
</code></pre>
