static public function escapeXmlSpecialChars($string, $isAttribute = false)
    {
        if ($isAttribute === false) {
            $fullSearch = array('"', "'", '<', '>');
            $fullReplace = array('&quot;', '&apos;', '&lt;', '&gt;');
            $string = str_replace('&', '&amp;', $string);
            $string = str_replace($fullSearch, $fullReplace, $string);
            return $string;
        } else {
            $string = str_replace('&', '&amp;', $string);
            $string = str_replace('"', '&quot;', $string);
            return $string;
        }
    }