String link = "";
// First create a new XMLInputFactory
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
// Setup a new eventReader
InputStream in = read();
XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
// Read the XML document
while (eventReader.hasNext())
{
XMLEvent event = eventReader.nextEvent();
if (event.isStartElement())
{
if (event.asStartElement().getName().getLocalPart().equals(TITLE))
{
event = eventReader.nextEvent();
title = event.asCharacters().getData();
continue;
}
if (event.asStartElement().getName().getLocalPart().equals(LINK))
{
event = eventReader.nextEvent();
link = event.asCharacters().getData();
continue;
}
}
else if (event.isEndElement())