Here you can find the source of loadData(String xmlData)
public static XmlPullParser loadData(String xmlData) throws XmlPullParserException
//package com.java2s; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; public class Main { public static XmlPullParser loadData(String xmlData) throws XmlPullParserException { XmlPullParserFactory parserFactory = XmlPullParserFactory .newInstance();/*from ww w . j a v a 2 s . c om*/ XmlPullParser parser = parserFactory.newPullParser(); parser.setInput(new StringReader(xmlData)); return parser; } }