Here you can find the source of getInteger(Document doc, String tagName)
public static Integer getInteger(Document doc, String tagName) throws Exception
//package com.java2s; import org.w3c.dom.Document; import org.w3c.dom.NodeList; public class Main { public static Integer getInteger(Document doc, String tagName) throws Exception { NodeList values = doc.getDocumentElement().getElementsByTagName( tagName);//from w w w.j a v a2 s . com if (values.getLength() == 1) { return Integer.parseInt(values.item(0).getTextContent()); // TODO NumberFormatExceptionHandling } throw new Exception("more than one " + tagName + " elements"); // TODO create custom exception } }