Here you can find the source of getXmlPullParser(String xml)
public static XmlPullParser getXmlPullParser(String xml) throws XmlPullParserException, IOException
//package com.java2s; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import java.io.IOException; import java.io.StringReader; public class Main { /**// ww w . j a v a2 s . c o m * Get a default XmlPullParser */ public static XmlPullParser getXmlPullParser(String xml) throws XmlPullParserException, IOException { XmlPullParserFactory xppFactory = XmlPullParserFactory .newInstance(); xppFactory.setNamespaceAware(false); XmlPullParser parser = xppFactory.newPullParser(); parser.setInput(new StringReader(xml)); parser.nextTag(); return parser; } }