protected function xmlEncode($txt)
    {
        $txt = str_replace('<', '&lt;', $txt);
        $txt = str_replace('>', '&gt;', $txt);
        $txt = str_replace('&amp;apos;', "'", $txt);
        $txt = str_replace('&amp;quot;', '"', $txt);

        return $txt;
    }
protected function xmlEncode($txt)
    {
        $txt = str_replace('<', '&lt;', $txt);
        $txt = str_replace('>', '&gt;', $txt);
        $txt = str_replace('&amp;apos;', "'", $txt);
        $txt = str_replace('&amp;quot;', '"', $txt);

        return $txt;
    }
protected function xmlEncode ( $ txt ) { $ txt = str_replace ( '<' , '&lt;' , $ txt ) ; $ txt = str_replace ( '>' , '&gt;' , $ txt ) ; $ txt = str_replace ( '&amp;apos;' , "'" , $ txt ) ; $ txt = str_replace ( '&amp;quot;' , '"' , $ txt ) ; return $ txt ; }
Encode the XML-characters in a string

@param string $txt A string to be encoded

@return string
Encode the XML - characters in a string