You can't call PHP from XSL. That's not what XSL is for.
XSL lets you transform XML. If you think you should be calling PHP from it, you've missed the point.
Yes, some (idiotic) vendors allow you to embed calls to code inside XSL using their extensions. This doesn't mean doing so is a good idea.
Generate the XML from PHP, then transform it with XSL. There is no need to call PHP from XSL. Really.
Mark
PS: Personally I think XSL is a bad idea in most cases anyway, having used it in production. However, if that is part of your design and you believe it is valid, fair enough.