*/ error_reporting( E_ALL ); require_once 'XML/Beautifier.php'; $options = array( "normalizeComments" => true, ); $fmt = new XML_Beautifier($options); $result = $fmt->formatFile('test.xml', 'test2.xml'); echo "

Original file

"; echo "
";
    echo htmlspecialchars(implode("",file('test.xml')));
    echo "
"; echo "

"; echo "

Beautified file

"; echo "
";
    echo htmlspecialchars(implode("",file('test2.xml')));
    echo "
"; ?>