Java tutorial
//package com.java2s; /* * JLib - Publicitas Java library v1.2.0. * * Copyright (c) 2005, 2006, 2007, 2008, 2009 Publicitas SA. * Licensed under LGPL (LGPL-LICENSE.txt) license. */ import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static Element GetFirstElementChild(Element tag) { Node n = tag.getFirstChild(); while (n.getNodeType() != Node.ELEMENT_NODE) { n = n.getNextSibling(); } Element e = (Element) n; return e; } }