Here you can find the source of getFirstMatchingDeepChildByTagName(final Element e, final String tagName)
public static Element getFirstMatchingDeepChildByTagName(final Element e, final String tagName)
//package com.java2s; //License from project: LGPL import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element getFirstMatchingDeepChildByTagName(final Element e, final String tagName) { NodeList matchingElements = e.getElementsByTagName(tagName); if (matchingElements != null) { return (Element) matchingElements.item(0); } else {//from w w w .ja v a 2 s . c o m return null; } } }