import org.xml.sax;
import java.io.*;
import java.util.zip.*;
...
try {
URL u = new URL("http://metalab.unc.edu/xml/examples/1998validstats.xml.gz");
InputStream raw = u.openStream();
InputStream decompressed = new GZIPInputStream(in);
InputSource in = new InputSource(decompressed);
// read the document...
}
catch (IOException e) {
System.err.println(e);
}
catch (SAXException e) {
System.err.println(e);
}