title: How to add an element to xml file by using elementtree
body: <p>I've a xml file, and I'm trying to add additional element to it.
  the xml has the next structure :</p>
  
  <pre><code>&lt;root&gt;
    &lt;OldNode/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>What I'm looking for is :</p>
  
  <pre><code>&lt;root&gt;
    &lt;OldNode/&gt;
    &lt;NewNode/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>but actually I'm getting next xml :</p>
  
  <pre><code>&lt;root&gt;
    &lt;OldNode/&gt;
  &lt;/root&gt;
  
  &lt;root&gt;
    &lt;OldNode/&gt;
    &lt;NewNode/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>My code looks like that :</p>
  
  <pre><code>file = open("/tmp/" + executionID +".xml", 'a')
  xmlRoot = xml.parse("/tmp/" + executionID +".xml").getroot()
  
  child = xml.Element("NewNode")
  xmlRoot.append(child)
  
  xml.ElementTree(root).write(file)
  
  file.close()
  </code></pre>
  
  <p>Thanks.</p>