I've been working with PHP 5's simplexml parser and I love how easy it is to use but when I used the asXML(filename) method I find that the file generated doesn't have the formatting I would like it to have. Everything is spilled into one line, is there a way to write the XML in the more human-readable form as below?
<root>
<child>
<grandchild>
</grandchild>
<child>
<root>
<root>
<child>
<grandchild>
</grandchild>
<child>
<root>