code: public static Element getChildElementByName(Element parent, String name)
      {
          NodeList children = parent.getChildNodes();
  
          for(int i = 0; i < children.getLength(); i++) {
              Node node = children.item(i);
              if(node.getNodeType() == Node.ELEMENT_NODE) {
                  Element element = (Element) node;
                  if(element.getTagName().equals(name)) {
                      return element;
                  }
              }
          }
  
          return null;
      }
docs: <p>Returns the first child element with the given name. Returns
  <code>null</code> if not found.</p>
  
  @param parent parent element
  @param name name of the child element
  @return child element