Here you can find the source of getString(Element root, String name)
public static String getString(Element root, String name)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; public class Main { public static String getString(Element root, String name) { try {// w w w . java 2s. c o m Element e = (Element) root.getElementsByTagName(name).item(0); return e.getTextContent(); } catch (Exception e) { System.err.println("Failed to parse String for tag " + name + "!"); } return "NOT SET"; } }