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;
    }