Ever wanted to format your XML nicely? Use the SimpleDOM class.

Usage is like so:

include "SimpleDOM.php";
 
$xml = "<foo><bar>car</bar></foo>";
$dom = simpledom_load_string($xml);
$xml = $dom->asPrettyXML();
echo $xml;

Produces:

&lt;?xml version="1.0"?&gt;
&lt;foo&gt;
  &lt;bar&gt;car&lt;/bar&gt;
&lt;/foo&gt;