load('model.xml'); // load the transformation stylesheet $xsl = new DOMDocument; $xsl->load('dbd2propel.xsl'); $proc = new XSLTProcessor(); // attach the xsl rules $proc->importStyleSheet($xsl); $schema_xml = $proc->transformToXML($xml); file_put_contents('schema.xml', $schema_xml);