Java tutorial
//package com.java2s; /* * The following methods come from a library written by Tom Fennelly. * Here was the header of the licence. */ import org.w3c.dom.*; public class Main { public static Node getFirstChildElementNode(Node node) { if (node == null) return (null); NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (Node.ELEMENT_NODE == child.getNodeType()) return (child); } return (null); } }