For xml parsing of an inputstream you can do:
// the SAX way:
XMLReader myReader = XMLReaderFactory.createXMLReader();
myReader.setContentHandler(handler);
myReader.parse(new InputSource(new URL(url).openStream()));
// or if you prefer DOM:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new URL(url).openStream());
But to communicate over http from server to client I prefer using hessian library or springs http invoker lib
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…