Here you can find the source of getElementByTagName(Element el, String tag)
public static Element getElementByTagName(Element el, String tag)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element getElementByTagName(Element el, String tag) { NodeList nl = el.getElementsByTagName(tag); if (nl.getLength() > 0) { return (Element) nl.item(0); }/*from w w w . j a v a2s.com*/ return null; } }