Java tutorial
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getTag(org.w3c.dom.Element e, String index) { NodeList nList = e.getElementsByTagName(index); if (nList.getLength() != 0) { Node nNode = nList.item(0); return nNode.getTextContent(); } return null; } }