Here you can find the source of getJSoupXmlDocument(final String url)
public static Document getJSoupXmlDocument(final String url)
//package com.java2s; //License from project: Open Source License import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.parser.Parser; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; public class Main { public static Document getJSoupXmlDocument(final String url) { final String rawXml = getTextFromURL(url); return Jsoup.parse(rawXml, "", Parser.xmlParser()); }//from w ww . j ava2 s.c o m public static String getTextFromURL(final String url) { StringBuilder result = new StringBuilder(); try { final URL website = new URL(url); final URLConnection connection = website.openConnection(); final BufferedReader in = new BufferedReader( new InputStreamReader(connection.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) result.append(inputLine); in.close(); } catch (MalformedURLException e) { e.printStackTrace(); //TODO FCRES: Autogenerated, modify } catch (IOException e) { e.printStackTrace(); //TODO FCRES: Autogenerated, modify } return result.toString(); } }