public static function format($str)
    {
        $dom = new \DOMDocument();
        $dom->loadXML($str);
        $dom->formatOutput = true;
        return $dom->saveXML();
    }
public static function format($str)
    {
        $dom = new \DOMDocument();
        $dom->loadXML($str);
        $dom->formatOutput = true;
        return $dom->saveXML();
    }
public static function format ( $ str ) { $ dom = new \ DOMDocument ( ) ; $ dom -> loadXML ( $ str ) ; $ dom -> formatOutput = true ; return $ dom -> saveXML ( ) ; }
Format an XML string using libxml's domdocument formatter

@param string $str
@return string
Format an XML string using libxml s domdocument formatter