Code example for XmlPullParser

Methods: getTextnextnextTagrequire

        return category;
    // Processes description tags in the feed. 
    private static String readBody(XmlPullParser parser) throws IOException, XmlPullParserException {
        parser.require(XmlPullParser.START_TAG, ns, "content:encoded");
        String body = readText(parser);
        parser.require(XmlPullParser.END_TAG, ns, "content:encoded");
        return body;
    // For the tags title and summary, extracts their text values. 
    private static String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
        String result = "";
        if ( == XmlPullParser.TEXT) {
            result = parser.getText();
        return result;
    // Skips tags the parser isn't interested in. Uses depth to handle nested tags. i.e.,