static function loadXML($sContent) { //TODO prepareXmlValueToXml should only be applied between <anwv/> tags $sContent = AnwXml::prepareXmlValueToXml($sContent); //we don't want > and < to be converted in normal chars but keep html entities as they are $sContent = str_replace('&', '&', $sContent); $oDoc = self::newDomDocument(); libxml_use_internal_errors(true); $bTest = $oDoc->loadXML($sContent); if (!$bTest) { throw new AnwUnexpectedException("loadXML failed"); } return $oDoc->documentElement; }