There are many reasons this could not be implemented as requested. You have placed dependencies in JXPathContext upon NodePointer, etc., from the reference implementation. What I have done is change the RI such that it delegates the creation of variable pointers to the registered NodePointerFactories as it does with the other various nodes in a given graph, wrapping the context itself in a type that the new VariablePointerFactory NodePointerFactory implementation recognizes. Now you will extend the RI in much the same way as you would any other time you needed to add a custom NodePointerFactory, except that you will trigger your VariablePointerFactory, or replacement thereof, on the VariablePointerFactory.VariableContextWrapper bean type. Since the default implementation is now being used for the creation of VariablePointers the existing testcases validate that this functionality is working properly.