try {
XmlPullParser xmlParser = xmlFactory.createParser();
if (entryClass == SpreadsheetEntry.class) {
return new XmlSpreadsheetsGDataParser(is, xmlParser);
} else if (entryClass == WorksheetEntry.class) {
return new XmlWorksheetsGDataParser(is, xmlParser);
} else if (entryClass == CellEntry.class) {
return new XmlCellsGDataParser(is, xmlParser);
} else if (entryClass == ListEntry.class) {
return new XmlListGDataParser(is, xmlParser);
} else {
throw new ParseException("Unrecognized feed requested.");
}
} catch (XmlPullParserException e) {
throw new ParseException("Failed to create parser", e);
}