Hello all,<br>I love the etree stuff and I&#39;m excited about the API additions that this team is adding to make it better.&nbsp; Thanks for all your work.&nbsp; That said I&#39;m really new to ElementTree.<br><br>I am using lxml.etree
 version 1.3.3 on both Python 2.4.3 and 2.5.1.<br>
<br>I have a question about processing instructions and round trip file processing.<br>Let&#39;s say I have a file &#39;test.xml&#39; containing the following<br><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
<br>&lt;!DOCTYPE project SYSTEM &quot;test.dtd&quot;&gt;<br>&lt;project&gt;&lt;a&gt;&lt;b/&gt;&lt;/a&gt;&lt;/project&gt;<br><br>Then I run these commands<br><br>t1=etree.parse(&#39;test.xml&#39;)<br>t1.write(&#39;testout.xml
&#39;, xml_declaration=True)<br><br>testout.xml looks like this:<br>&lt;?xml version=&#39;1.0&#39; encoding=&#39;ASCII&#39;?&gt;<br>&lt;project&gt;&lt;a&gt;&lt;b/&gt;&lt;/a&gt;&lt;/project&gt;<br><br>I see that t1.docinfo.doctype
 contains:<br>&lt;!DOCTYPE project SYSTEM &quot;test.dtd&quot;&gt;<br>
<br>So why isn&#39;t the PI written to the file?<br><br>I am parsing/modifying a file for consumption by another program that refuses to load the file without the PI.<br clear="all">Thanks<br>Greg<br><br>-- <br>Linux.&nbsp;&nbsp;Because rebooting is for adding hardware.