code: public static NodeList applyXpathExpressionToDocument(String _xpathExpression, Node _xmlDocumentOrNode)
              throws IOException {
  
          XPathFactory xfactory = XPathFactory.newInstance();
          XPath xpath = xfactory.newXPath();
          XPathExpression expr = null;
          try {
              expr = xpath.compile(_xpathExpression);
          } catch (XPathExpressionException _ex) {
              throw new IOException(_ex);
          }
  
          Object result = null;
          try {
              result = expr.evaluate(_xmlDocumentOrNode, XPathConstants.NODESET);
          } catch (Exception _ex) {
              throw new IOException(_ex);
          }
  
          return (NodeList) result;
      }
docs: Applys a xpathExpression to a xml-Document and return a {@link NodeList} with the results.
  
  @param _xpathExpression xpath expression
  @param _xmlDocumentOrNode document or node
  @return {@link NodeList}
  @throws IOException on error