public static function getXmlDoc($intId) { global $_PATHS; $objStructure = Structure::selectByPk($intId); $strXml = $_PATHS['structures'] . $objStructure->getFileName() . ".xml"; //*** Init DOM object. $objDoc = new DOMDocument("1.0", "UTF-8"); $objDoc->formatOutput = false; $objDoc->preserveWhiteSpace = true; if (is_file($strXml)) { $objDoc->load($strXml); } else { $objDoc->loadXML($strXml); } return $objDoc; }