code: public Object xpathQuery(String xpath, QName type, NamespaceContext nsContext)
          throws XPathExpressionException {
              XPathFactory xpathFactory = XPathFactory.newInstance();
              XPath xPath = xpathFactory.newXPath();
              if (nsContext != null) {
                  xPath.setNamespaceContext(nsContext);
              }
              XPathExpression xpathExp = xPath.compile(xpath);
              try {
                  return xpathExp.evaluate(this.xmlNode, type);
              } catch (IllegalArgumentException e) {
                  // Thrown if item found does not match expected type
                  return null;
              }
          }
docs: Return the result of evaluating an XPath query on the builder's DOM
  using the given namespace. Returns null if the query finds nothing,
  or finds a node that does not match the type specified by returnType.
  
  @param xpath
  an XPath expression
  @param type
  the type the XPath is expected to resolve to, e.g:
  {@link XPathConstants#NODE}, {@link XPathConstants#NODESET},
  {@link XPathConstants#STRING}.
  @param nsContext
  a mapping of prefixes to namespace URIs that allows the XPath expression
  to use namespaces, or null for a non-namespaced document.
  
  @return
  a builder node representing the first Element that matches the
  XPath expression.
  
  @throws XPathExpressionException
  If the XPath is invalid, or if does not resolve to at least one
  {@link Node#ELEMENT_NODE}.