Java tutorial
//package com.java2s; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static boolean hasChild(Node xml, String name) { NodeList nl = xml.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node n = nl.item(i); if (name.equalsIgnoreCase(n.getNodeName())) return true; } return false; } }