try {
XmlPullParser parser = getResources().getXml(R.xml.troll);
public Document getDocument(String url) throws MalformedURLException,
IOException, Exception {
URL documentUrl = new URL(url);
URLConnection conn = documentUrl.openConnection();
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document;
InputStream stream = null;
try {
stream = conn.getInputStream();
document = builder.parse(stream);
} finally {
if (stream != null)
stream.close();
}
return document;
}