How can I download an XML file from a URL and convert the XML file to a string? In particular, I want to download an RSS feed and convert it to a string.
I tried this, but it didn't work:
protected List<Rss> doInBackground(Void... params) {
String xmlContent;
Document doc = null;
try {
doc = Jsoup.connect(feedUrl).get();
} catch (IOException e) {
e.printStackTrace();
}
xmlContent = doc.toString();
return RssParser.parseFeed(xmlContent);
}