// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

public class GetXml {
    public static String getXml(String urlstr) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader((new URL(urlstr)).openConnection().getInputStream()));
        StringBuilder res = new StringBuilder();
        String line;
        while((line = br.readLine()) != null) {
            res.append(line);
            res.append("\r\n");
        }
        br.close();
        return res.toString();
    }
    public static void main(String[] args) throws Exception {
        System.out.println(getXml("http://localhost:81/listpersons_webservice.xml"));
    }
}
