Java examples for XML:DOM Element
get Sub XML Element
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { private static Node getSubElement(Node parent, String name) { NodeList nodes = ((Element) parent).getElementsByTagName(name); if (nodes.getLength() == 0) { return null; }//from w w w . j a va 2s.c om return nodes.item(0); } }