Java tutorial
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /** * Checks if the given {@link NodeList} contains a child element. * * @param list The {@link NodeList} to check. * @return Whether the {@link NodeList} contains children. */ public static boolean hasChildElement(NodeList list) { Node n; for (int i = 0; i < list.getLength(); i++) { n = list.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { return true; } } return false; } }