https://github.com/mfreed7/xslt_polyfill/pull/5 - it will be able to do this soon.
someone else mentioned xjslt here: https://news.ycombinator.com/item?id=44994310 which is an xslt 2.0 implementation. i have been trying to get that to work by loading the script directly into the xml data but so far could not figure out how to do it.