title: Python pretty XML printer with lxml
body: <p>After reading from an existing file with 'ugly' XML and doing some modifications, pretty printing doesn't work. I've tried <code>etree.write(FILE_NAME, pretty_print=True)</code>. </p>
  
  <p>I have the following XML:</p>
  
  <pre><code>&lt;testsuites tests="14" failures="0" disabled="0" errors="0" time="0.306" name="AllTests"&gt;
      &lt;testsuite name="AIR" tests="14" failures="0" disabled="0" errors="0" time="0.306"&gt;
  ....
  </code></pre>
  
  <p>And I use it like this:</p>
  
  <pre><code>tree = etree.parse('original.xml')
  root = tree.getroot()
  
  ...    
  # modifications
  ...
  
  with open(FILE_NAME, "w") as f:
      tree.write(f, pretty_print=True)
  </code></pre>