src/XmlUtil.php
public static function getFormattedDocument($xml)
    {
        $oldValue = $xml->preserveWhiteSpace;
        $oldFormatOutput = $xml->formatOutput;

        $xml->preserveWhiteSpace = false;
        $xml->formatOutput = true;
        $document = $xml->saveXML();

        $xml->preserveWhiteSpace = $oldValue;
        $xml->formatOutput = $oldFormatOutput;

        return $document;
    }
public static function getFormattedDocument($xml)
    {
        $oldValue = $xml->preserveWhiteSpace;
        $oldFormatOutput = $xml->formatOutput;

        $xml->preserveWhiteSpace = false;
        $xml->formatOutput = true;
        $document = $xml->saveXML();

        $xml->preserveWhiteSpace = $oldValue;
        $xml->formatOutput = $oldFormatOutput;

        return $document;
    }
public static function getFormattedDocument ( $ xml ) { $ oldValue = $ xml -> preserveWhiteSpace ; $ oldFormatOutput = $ xml -> formatOutput ; $ xml -> preserveWhiteSpace = false ; $ xml -> formatOutput = true ; $ document = $ xml -> saveXML ( ) ; $ xml -> preserveWhiteSpace = $ oldValue ; $ xml -> formatOutput = $ oldFormatOutput ; return $ document ; }
Get document without xml parameters

@param DOMDocument $xml
@return string
Get document without xml parameters