Not really necessarily or appreciated to double post your question. You already posted exactly the same thing as a comment on my blog here: View all comments on this blog post
Same answer to you:
I'm not sure what problem you are having exactly. I cut and pasted your code you posted into an XSJS service in my system, ran it, and it downloaded a zip file exactly as it should.