Here you can find the source of readText(XmlPullParser parser)
public static String readText(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 String readText(XmlPullParser parser) throws IOException, XmlPullParserException {//from ww w . j av a2 s . c o m String result = ""; if (parser.next() == XmlPullParser.TEXT) { result = parser.getText(); parser.nextTag(); } return result; } }