Unless I'm misunderstanding things here, I cannot see any sense in having a XSLT file generate PHP code, as the client would not be able to do anything with it. The basic flow is:
- Client obtains the XML file, which includes a link to a XSLT file.
- Client obtains the XSLT file
- Client displays output based on the interaction of the XSLT file's instructions with the XML file's data
Therefore, all "processing" is done on the client, with the server just serving up the files requested by the client, so any PHP code generated by the XSLT file will not be able to be executed by the server, as it's all happening on the client.
However, it's entirely possible to have the XSLT file be a PHP file which, when requested by the client, dynamically outputs XSLT content based on whatever programming logic is required, with the generated output being pure XSLT. Perhaps this is what you're after?