Java Programming - Robust method on getting the xml content

i've written a program to download the xml content from the website and use the xslt transformation to filter out the information i need. when i'm testing my program, i get an error in reading the xml file due to downloading of big size of xml. so i'm looking for other robust method to get xml content, any methods recommend ?

here is my current method, i need another method to replace the content in '/* */' :

public class FileDownload {

public static void download(String address, String localFileName){

OutputStream out = null;

URLConnection conn = null;

InputStream in = null;

StringBuffer xmlContentBuffer = new StringBuffer();

String temp = new String();

String xmlContent;

Public Object getContent(URLConnection u)

try {

/*

URL url = new URL(address);

out = new BufferedOutputStream(

new FileOutputStream(localFileName));

conn = url.openConnection();

in = conn.getInputStream();

byte[] buffer = new byte[1024];

int numRead;

long numWritten = 0;

System.out.println (in.toString ());

while ((numRead = in.read(buffer)) != -1) {

out.write(buffer, 0, numRead);

numWritten += numRead;

temp = new String(buffer);

xmlContentBuffer.append(temp);

Thread.sleep(50);

}

System.out.println(localFileName + "\t" + numWritten);

xmlContent = xmlContentBuffer.toString();

*/

FileInputStream xslt2= new FileInputStream ("test.xml");

int x2= xslt2.available();

byte b2[]= new byte[x2];

xslt2.read(b2);

xmlContent = new String(b2);

[1668 byte] By [Simon_javaa] at [2007-11-26 23:15:24]
# 1
you can check out in the apache commons packages
suparenoa at 2007-7-10 14:15:07 > top of Java-index,Java Essentials,Java Programming...
# 2
It would be helpful if you said what the error was. Post the actual error message, not a limp paraphrase of it.And why are you reading your XML file into a string?
DrClapa at 2007-7-10 14:15:07 > top of Java-index,Java Essentials,Java Programming...