code: public Node extractNode(@Nullable Node parentNode, Iterable<String> xPath) {
      Preconditions.checkNotNull(xPath, "Null xpath list");
      Node node = parentNode;
      boolean wasMatch = false;
      Iterator<String> xPathElementsIter = xPath.iterator();
      while (xPathElementsIter.hasNext() && node != null) {
        wasMatch = false;
        String localName = xPathElementsIter.next();
        NodeList childNodes = node.getChildNodes();
        for (int i = 0; i < childNodes.getLength(); i++) {
          Node childNode = childNodes.item(i);
          String childName = childNode.getLocalName();
          if (childName == null || childName.contains(":")) {
            childName = childNode.getNodeName();
          }
          if (localName.equals(childName)) {
            node = childNode;
            wasMatch = true;
            break;
          }
        }
      }
      return wasMatch ? node : null;
    }
docs: Extracts the node specified by the xpath list.
  
  @param parentNode the node to extract the child node from.
  @param xPath xpath elements for <em>local</em> names that make up the child node's xpath.
  @return the matching {@link Node}, or {@code null} if no such child node exists.