code: @Nonnull
    public static XPath createNewXPath (@Nonnull final XPathFactory aXPathFactory,
                                        @Nullable final XPathVariableResolver aVariableResolver,
                                        @Nullable final XPathFunctionResolver aFunctionResolver,
                                        @Nullable final NamespaceContext aNamespaceContext)
    {
      ValueEnforcer.notNull (aXPathFactory, "XPathFactory");
  
      final XPath aXPath = aXPathFactory.newXPath ();
      if (aVariableResolver != null)
        aXPath.setXPathVariableResolver (aVariableResolver);
      if (aFunctionResolver != null)
        aXPath.setXPathFunctionResolver (aFunctionResolver);
      if (aNamespaceContext != null)
        aXPath.setNamespaceContext (aNamespaceContext);
      return aXPath;
    }
docs: Create a new {@link XPath} with the passed variable resolver, function
  resolver and namespace context.
  
  @param aXPathFactory
  The XPath factory object to use. May not be <code>null</code>.
  @param aVariableResolver
  Variable resolver to be used. May be <code>null</code>.
  @param aFunctionResolver
  Function resolver to be used. May be <code>null</code>.
  @param aNamespaceContext
  Namespace context to be used. May be <code>null</code>.
  @return The created non-<code>null</code> {@link XPath} object