",$xmlstring); // in decimal form while (preg_match("@&#(\d+);@",$xmlstring, $matches)) { $xmlstring = preg_replace("@&#".$matches[1].";@",code_to_utf8($matches[1]),$xmlstring); }; // in hexadecimal form while (preg_match("@&#x(\d+);@i",$xmlstring, $matches)) { $xmlstring = preg_replace("@&#x".$matches[1].";@i",code_to_utf8(hexdec($matches[1])),$xmlstring); }; $tree = ActiveLinkDOMTree::from_XML(new XML($xmlstring)); return $tree; } die("None of DOM/XML, DOM or ActiveLink DOM extension found. Check your PHP configuration."); } }; ?>