Here you can find the source of GetFirstElementChild(Element tag)
public static Element GetFirstElementChild(Element tag)
//package com.java2s; /*//from w w w .j ava2 s . c om * 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; } }