code: private void configureSaxonExtensions(SaxonTransformerFactory tfi) {
          final net.sf.saxon.Configuration conf = tfi.getConfiguration();
          for (ExtensionFunctionDefinition def : ServiceLoader.load(ExtensionFunctionDefinition.class)) {
              try {
                  conf.registerExtensionFunction(def.getClass().newInstance());
              } catch (InstantiationException e) {
                  throw new RuntimeException("Failed to register " + def.getFunctionQName().getDisplayName()
                          + ". Cannot create instance of " + def.getClass().getName() + ": " + e.getMessage(), e);
              } catch (IllegalAccessException e) {
                  throw new RuntimeException(e);
              }
          }
      }
docs: Registers Saxon full integrated function definitions.
  The intgrated function should be an instance of net.sf.saxon.lib.ExtensionFunctionDefinition abstract class.
  @see <a href="https://www.saxonica.com/html/documentation/extensibility/integratedfunctions/ext-full-J.html">Saxon
  Java extension functions: full interface</a>