title: PHP simpleXML how to save the file in a formatted way?
body: <p>I'm trying add some data to an existing XML file using PHP's SimpleXML. The problem is it adds all the data in a single line:</p>
  
  <pre><code>&lt;name&gt;blah&lt;/name&gt;&lt;class&gt;blah&lt;/class&gt;&lt;area&gt;blah&lt;/area&gt; ...
  </code></pre>
  
  <p>And so on. All in a single line. How to introduce line breaks?</p>
  
  <p>How do I make it like this?</p>
  
  <pre><code>&lt;name&gt;blah&lt;/name&gt;
  &lt;class&gt;blah&lt;/class&gt;
  &lt;area&gt;blah&lt;/area&gt;
  </code></pre>
  
  <p>I am using <code>asXML()</code> function.</p>
  
  <p>Thanks.</p>