xsl transform template for php5

// path to the xml document (may be url) $xml = “data.xml”; // path to the xsl document (may be url) $xsl = “transformation.xsl”; $xslDoc = new DOMDocument(); $xslDoc->load($xsl); $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); $proc = new XSLTProcessor(); $proc->importStylesheet($xslDoc); echo $proc->transformToXML($xmlDoc);