code: public static QueryRootNode createQuery(String statement,
         LocationFactory resolver,
                                              QueryNodeFactory factory)
              throws InvalidQueryException {
          return new XPathQueryBuilder(statement, resolver, factory).getRootNode();
      }
docs: Creates a <code>QueryNode</code> tree from a XPath statement using the
  passed query node <code>factory</code>.
  
  @param statement the XPath statement.
  @param resolver  the name resolver to use.
  @param factory   the query node factory.
  @return the <code>QueryNode</code> tree for the XPath statement.
  @throws InvalidQueryException if the XPath statement is malformed.