code: protected Element findTag(String tagName, Element element) {
          Node result = element.getFirstChild();
          
          while (result != null) {
              if (result instanceof Element
                      && (tagName.equals(((Element) result).getNodeName()) || tagName
                              .equals(((Element) result).getLocalName()))) {
                  break;
              }
              result = result.getNextSibling();
          }
          
          return (Element) result;
      }
docs: Find the child element whose tag matches the specified tag name.
  
  @param tagName Tag name to locate.
  @param element Parent element whose children are to be searched.
  @return The matching node (first occurrence only) or null if not found.