// Tools for Java interface handling
AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
JavaInterfaceFactory javaFactory = factories.getFactory(JavaInterfaceFactory.class);
// Create the artifact processor for XQuery artifacts and add to artifact processors
xqueryArtifactProcessor = new XQueryArtifactProcessor(assemblyFactory, javaFactory);
StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
staxProcessors.addArtifactProcessor(xqueryArtifactProcessor);
// Create XQueryImplementationProviderFactory and add to provider factories