title: minidom appendchild/insertBefore
body: <p>I'm using Python and minidom to insert Data in an existing XML-file. When I do so, I get correct XML-code but it doesn't look as I want it. 
  This is an example for my xml-file at the beginning. </p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  &lt;sim&gt;
      &lt;tool name="A"/&gt;
      &lt;calcSequence&gt;
          &lt;entry&gt;FD_so&lt;/entry&gt;
          &lt;entry&gt;FD_ped&lt;/entry&gt;
          &lt;entry&gt;FD_veh&lt;/entry&gt;
      &lt;/calcSequence&gt;
  &lt;/sim&gt;
  </code></pre>
  
  <p>Now the code: </p>
  
  <pre><code>calcSequence = doc.getElementsByTagName('calcSequence')[0]
  entrys = calcSequence.getElementsByTagName('entry')
  hnode = doc.createElement('entry')
  htext = doc.createTextNode('test')
  hnode.appendChild(htext)
  calcSequence.insertBefore(hnode,entrys[2])
  </code></pre>
  
  <p>And the result: </p>
  
  <pre><code>&lt;calcSequence&gt;
      &lt;entry&gt;FD_so&lt;/entry&gt;
      &lt;entry&gt;FD_ped&lt;/entry&gt;
      &lt;entry&gt;test&lt;/entry&gt;&lt;entry&gt;FD_veh&lt;/entry&gt;
  &lt;/calcSequence&gt;
  </code></pre>
  
  <p>Is there a way to insert the missing newline between the 2 <code>&lt;entry&gt;</code>s? 
  doc.toprettyxml() isn't a solution, since this is only a small part of the xml, and I do not want to insert blank lines after every line in the document. </p>