private function convertSgmlToXml($sgml)
    {
        $sgml = preg_replace('/&(?!#?[a-z0-9]+;)/', '&amp;', $sgml);

        $lines = explode("\n", $sgml);

        $xml = '';
        foreach ($lines as $line) {
            $xml .= trim($this->closeUnclosedXmlTags($line)) . "\n";
        }

        return trim($xml);
    }
private function convertSgmlToXml($sgml)
    {
        $sgml = preg_replace('/&(?!#?[a-z0-9]+;)/', '&amp;', $sgml);

        $lines = explode("\n", $sgml);

        $xml = '';
        foreach ($lines as $line) {
            $xml .= trim($this->closeUnclosedXmlTags($line)) . "\n";
        }

        return trim($xml);
    }
private function convertSgmlToXml ( $ sgml ) { $ sgml = preg_replace ( '/&(?!#?[a-z0-9]+;)/' , '&amp;' , $ sgml ) ; $ lines = explode ( "\n" , $ sgml ) ; $ xml = '' ; foreach ( $ lines as $ line ) { $ xml .= trim ( $ this -> closeUnclosedXmlTags ( $ line ) ) . "\n" ; } return trim ( $ xml ) ; }
Convert an SGML to an XML string

@param string $sgml
@return string
Convert an SGML to an XML string