title: Appending an xml-node which is read from file breaks pretty_print for adjacent nodes
body: <p>I'm generating a XML-file with python's etree library. One node in the generated file is read from an existing XML-file. Adding this element breaks the pretty_print for the nodes directly before and after.</p>
  
  <pre class="lang-py prettyprint-override"><code>import xml.etree.cElementTree as ET
  from lxml import etree
  
  root = etree.Element("startNode")
  subnode1 = etree.SubElement(root, "SubNode1")
  subnode1Child1 = etree.SubElement(subnode1, "subNode1Child1")
  etree.SubElement(subnode1Child1, "Child1")
  etree.SubElement(subnode1Child1, "Child2")
  
  f = open('/xml_testdata/ext_file.xml','r')
  ext_xml = etree.fromstring(f.read())
  ext_subnode = ext_xml.find("ExtNode")
  subnode1.append(ext_subnode)
  
  subnode1Child2 = etree.SubElement(subnode1, "subNode1Child2")
  etree.SubElement(subnode1Child2, "Child1")
  etree.SubElement(subnode1Child2, "Child2")
  
  tree = etree.ElementTree(root)
  tree.write("testfile.xml", xml_declaration=True, pretty_print=True)
  </code></pre>
  
  <p>which gives this result:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;startNode&gt;
      &lt;SubNode1&gt;&lt;subNode1Child1&gt;&lt;Child1/&gt;&lt;Child2/&gt;&lt;/subNode1Child1&gt;&lt;ExtNode&gt;
              &lt;NodeFromExt&gt;
                  &lt;SubNodeFromExt1/&gt;
              &lt;/NodeFromExt&gt;
              &lt;NodeFromExt&gt;
                  &lt;SubNodeFromExt2/&gt;
                  &lt;AnotherSubNodeFromExt2&gt;
                      &lt;SubSubNode/&gt;
                      &lt;AllPrettyHere&gt;
                          &lt;Child/&gt;
                      &lt;/AllPrettyHere&gt;
                  &lt;/AnotherSubNodeFromExt2&gt;
              &lt;/NodeFromExt&gt;
      &lt;/ExtNode&gt;
      &lt;subNode1Child2&gt;&lt;Child1/&gt;&lt;Child2/&gt;&lt;/subNode1Child2&gt;&lt;/SubNode1&gt;
  &lt;/startNode&gt;
  </code></pre>
  
  <p>Not very readable, is it? Even worse when "subNodeChild" contains a lot more subnodes than this example!</p>
  
  <p>Without appending the external elements, it looks like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;startNode&gt;
    &lt;SubNode1&gt;
      &lt;subNode1Child1&gt;
        &lt;Child1/&gt;
        &lt;Child2/&gt;
      &lt;/subNode1Child1&gt;
      &lt;subNode1Child2&gt;
        &lt;Child1/&gt;
        &lt;Child2/&gt;
      &lt;/subNode1Child2&gt;
    &lt;/SubNode1&gt;
  &lt;/startNode&gt;
  </code></pre>
  
  <p>So the problem is caused by appending the external elements!</p>
  
  <p>Is there a way to append the external elements without breaking the pretty_print-output?</p>