Information on writing Java extension functions for calling from Saxon XSLT code can be found here:
http://www.saxonica.com/documentatio...!extensibility
The mechanism of "reflexive extension functions" which allows you to call directly into your Java code is not available in Saxon-HE. But you can wrap it up as an "integrated extension function".
But really, the Luhn algorithm can be implemented as an XSLT function just as easily as in Java.