Here you can find the source of readString(XmlPullParser parser, String ns, String tag)
public static String readString(XmlPullParser parser, String ns, String tag) throws IOException, XmlPullParserException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; public class Main { public static String readString(XmlPullParser parser, String ns, String tag) throws IOException, XmlPullParserException { parser.require(XmlPullParser.START_TAG, ns, tag); String string = readText(parser); parser.require(XmlPullParser.END_TAG, ns, tag); return string; }/*from w w w . ja va 2 s. c o m*/ public static String readText(XmlPullParser parser) throws IOException, XmlPullParserException { String result = ""; if (parser.next() == XmlPullParser.TEXT) { result = parser.getText(); parser.nextTag(); } return result; } }