code: public Object peekDom(org.w3c.dom.Document doc, String xpathExpr) throws Exception {
          XPathFactory xPathfactory = XPathFactory.newInstance();
          XPath xpath = xPathfactory.newXPath();
          xpath.setNamespaceContext(new UniversalNamespaceCache(doc, false));
          XPathExpression expr = xpath.compile(xpathExpr);
          NodeList nodeList = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
          if (nodeList == null || nodeList.getLength() == 0) {
              return null;
          }
          else if (nodeList.getLength() == 1) {
              Node node = nodeList.item(0);
              if (node instanceof Attr)
                  return ((Attr) node).getValue();
              else
                  return node.getChildNodes().item(0).getNodeValue();
          }
          else {
              List<XPathHelper> childDocs = new ArrayList<XPathHelper>();
              for (int i = 0; i < nodeList.getLength(); i++) {
                  Node node = nodeList.item(i);
                  Document docVO = new Document();
                  docVO.setObject(DomHelper.toDomDocument(node));
                  docVO.setDocumentType(Document.class.getName());
                  childDocs.add(new XPathHelper(docVO, this));
              }
              return childDocs;
          }
      }
docs: Retrieves the value of a document element or attribute as a String. If
  multiple matches are found or the match has children, will return a List
  <XPathHelper>.
  
  @param xpath
  the expression indicating the document location
  @return a String, List<XPathHelper>, or null depending on how many
  matches are found