Here you can find the source of readText(XmlPullParser parser)
public static String readText(XmlPullParser parser) throws IOException, XmlPullParserException
//package com.java2s; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; public class Main { public static String readText(XmlPullParser parser) throws IOException, XmlPullParserException {/*ww w.jav a 2 s .co m*/ String result = ""; if (parser.next() == XmlPullParser.TEXT) { result = parser.getText(); parser.nextTag(); } return result; } }