doc = new \SimpleXMLElement("<$rootElement/>"); foreach (self::$runFirst as $fn) { $fn($this->doc); } } function sendRaw() { header('Content-Type: application/xml'); echo $this->doc->asXML(); } function send() { if (isset($_GET['RawXML'])) { $this->sendRaw(); return; } //header('Content-Type: application/xhtml+xml'); $processor = new \XSLTProcessor; $processor->registerPHPFunctionNS('urn:psso:xsl', 'L', 'L'); foreach (self::$stylesheets as $sheet) { $processor->importStylesheet($sheet); } //$root = \Dom\import_simplexml($this->doc); echo $processor->transformToXml($this->doc); } }