Here you can find the source of readNumber(XmlPullParser parser)
public static int readNumber(XmlPullParser parser) throws IOException, XmlPullParserException
//package com.java2s; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; public class Main { public static int readNumber(XmlPullParser parser) throws IOException, XmlPullParserException {/*from w ww .j a v a 2 s. c o m*/ try { String text = readText(parser); return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new XmlPullParserException("Expected number"); } } public static String readText(XmlPullParser parser) throws IOException, XmlPullParserException { String result = ""; if (parser.next() == XmlPullParser.TEXT) { result = parser.getText(); parser.nextTag(); } return result; } }