*/ error_reporting( E_ALL ); require_once 'XML/Beautifier.php'; $fmt = new XML_Beautifier( array( 'removeLineBreaks' => false ) ); $result = $fmt->formatFile('test3.xml'); echo "

Original file

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

"; echo "

Beautified output

"; echo "
";
    echo htmlspecialchars($result);
    echo "
"; ?>