The set up below did not work for me. The output csv was always blank. I added the following bit of mapping logic and it worked great:
//set message to csv
message = qie.createCSVMessage(true, '"', ',', 'UTF-8', true);
//set the query results to the message
message.setEndOfLine('\r\n'); //Add the CR/LF to the end of each line
message.setNode('/', source);