Java examples for XML:XML Element Child
get Child XML Element By Tag Name
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element getChildElementByTagName(Element e, String tagName) { NodeList l = e.getElementsByTagName(tagName); Element el = null;//from w w w .ja v a 2 s.c o m if (l.getLength() > 0) { el = (Element) l.item(0); } return el; } }