The problem doesn't appear to be the while loop, according to the stack trace.
09-03 16:31:50.108: W/System.err(16727): java.io.IOException: Stream is closed
09-03 16:31:50.108: W/System.err(16727): at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:158)
09-03 16:31:50.108: W/System.err(16727): at libcore.io.Streams.readSingleByte(Streams.java:41)
09-03 16:31:50.108: W/System.err(16727): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:128)
09-03 16:31:50.108: W/System.err(16727): at org.kxml2.io.KXmlParser.setInput(KXmlParser.java:1623)
It's throwing an exception at the setInput() in your code, before the while loop.
The root cause here could be a lot of things. I'd start by looking at the downloadUrl() code, and see if there's any reason why it might be returning a stream that's already closed.