load($xmlfile); $xsl = new DOMDocument; $xsl->load($xslfile); $proc->importStylesheet($xsl); // Squash warnings here because xsl complains about COURSE_ACCESS tags which really are invalid XML (multiple root elements) if($resultfile !== null) { $fp = fopen($resultfile, 'w'); fwrite($fp, @$proc->transformToXML($doc)); fclose($fp); return true; } else { return @$proc->transformToXML($doc); } } } // end if(true)