title: Python Minidom modify/append content files
body: <p>Since 8 hours I'm now trying to parse a XML and add 5 lines of text into the xml. I'm making really no progress and neither writexml, toxml nor saveXML seems to work from the minidom lib</p>
  
  <p>We want to parse the xml and add some lines before the closing  Tag. Sounds easy?</p>
  
  <p>So my situation is:
  A File called updates.xml</p>
  
  <blockquote>
  <pre><code>&lt;UpdateSite&gt;
     &lt;SomeTags&gt;&lt;/SomeTags&gt;
     &lt;SomeTags2&gt;&lt;/SomeTags2&gt;
     &lt;SomeTags3&gt;&lt;/SomeTags3&gt;
  
     &lt;SomeTags&gt;&lt;/SomeTags&gt;
     &lt;SomeTags2&gt;&lt;/SomeTags2&gt;
     &lt;SomeTags3&gt;&lt;/SomeTags3&gt;
  
     &lt;SomeTags&gt;&lt;/SomeTags&gt;
     &lt;SomeTags2&gt;&lt;/SomeTags2&gt;
     &lt;SomeTags3&gt;&lt;/SomeTags3&gt;
  &lt;/UpdateSite&gt;
  </code></pre>
  </blockquote>
  
  <p>What we are doing:</p>
  
  <pre><code>dom = xml.dom.minidom.parse("updates.xml")
  updateSite=dom.getElementsByTagName('UpdateSite')
  updateSite.append('&lt;SomeTags&gt;')
  updateSite.append("&lt;product&gt;xx.xxxxxx.xxx&lt;/product&gt;")
  updateSite.append("&lt;version style=\\"eclipse\\"&gt;"+$cleanVersion+"&lt;/version&gt;")
  updateSite.append("&lt;resource style=\\"executable\\"&gt;SomeURL&lt;/resource&gt;)
  updateSite.append("&lt;/update&gt;")
  dom.saveXML(self, updateSite)
  dom.writeXML(self, file_handle)
  dom.toxml(self)
  </code></pre>
  
  <p>updateSite contains the correct new lines, but the file just isn't updated. Can anyone explain this?</p>