Scenario: I have an XML doc (that I have converted to a String) which represents the KML file and I want to return a Zipped version of that file to save on bandwidth and the like. First of all you need to have somewhere to get the KML file from (in this case counter.getKML().
ZipEntry entry = new ZipEntry("geoblog.kml");
ZipOutputStream zipOutputStream = new ZipOutputStream(response.getOutputStream());
And that is it. Mind bogglingly simple.