Here you can find the source of getFirstChildWithTagName(Element parent, String tagName)
public static Element getFirstChildWithTagName(Element parent, String tagName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element getFirstChildWithTagName(Element parent, String tagName) {/* w ww .j a va 2 s.com*/ final NodeList elements = parent.getElementsByTagName(tagName); return (elements.getLength() > 0) ? (Element) (elements.item(0)) : null; } }