It would be nice if this weren't XSLT daffodil java function weren't dependant on Saxon's implementation. If Java XSLT has a way to handle this, and if it's compatible with XSLT, that might be a preferred method to implementation a DFDL XSLT function.