I think I have a solution.
If you want to execute PHP in your XML or XSL documents, take the following steps.
- place the XML/XSL in a file with a PHP extension
- place any XML tags that begin with <? into PHP echo statements so they are not mistaken by the PHP processor as PHP code
- designate the mime-type using the PHP command below
Here is how you designate the mime-type
header("content-type: application/xhtml+xml; charset=utf-8");
Hope this helps.