Problems parsing a xml file
<p>I am editing a xml file that is originally like that:</p>

<pre><code>    &lt;SequencerLoopCommand id="1073" 
     IterationCount="2"
     CommandList="1241 1242"
     Name="Loop Stream IDU64ToIDU63"&gt;
      &lt;IterateLoadSizeCommand id="1241" 
       LoadType="STEP"
       LoadUnits="KILOBITS_PER_SECOND"
       LoadStart="100"
       LoadEnd="200"
       LoadStep="100"
       CustomLoadList=""
       StreamBlockList="1543"
       Name="Iterate Stream IDU64ToIDU63"&gt;
      &lt;/IterateLoadSizeCommand&gt;
      &lt;WaitCommand id="1242" 
       WaitTime="5"
       Name="Stream IDU64ToIDU63"&gt;
      &lt;/WaitCommand&gt;
    &lt;/SequencerLoopCommand&gt;
</code></pre>

<p>With the following code...</p>

<pre><code>doc = minidom.parse("directory")

#processing

fh = open(os.path.join(self.__dirname,self.__xmlfile),"w")
doc.writexml(fh)
fh.close()
doc.unlink()
</code></pre>

<p>after that, my new xml is something like:</p>

<pre><code>&lt;SequencerLoopCommand CommandList="1241 1242" IterationCount="2" Name="Loop Stream IDU64ToIDU63" id="1073"&gt;
  &lt;IterateLoadSizeCommand CustomLoadList="" LoadEnd="200" LoadStart="100" LoadStep="100" LoadType="STEP" LoadUnits="KILOBITS_PER_SECOND" Name="Iterate Stream IDU64ToIDU63" StreamBlockList="1543" id="1241"&gt;
  &lt;/IterateLoadSizeCommand&gt;
  &lt;WaitCommand Name="Stream IDU64ToIDU63" WaitTime="5" id="1242"&gt;
  &lt;/WaitCommand&gt;
&lt;/SequencerLoopCommand&gt;
</code></pre>

<p>I need that the new file to have the same structure as the old one. Any tip?</p>

<p>Thank you</p>
