$xml = $dom->dump_mem(true); $xsl = join('',file('lib/templates/xslt/calculator.xsl')); // Allocate a new XSLT processor handler $xh = xslt_create(); $arguments = array( '/_xml' => $xml, '/_xsl' => $xsl ); if ($result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments)) { echo $result; }