Hi Eliot,
let $doWrite := file:write('/Users/eliot.kimber/temp/apps-to-topics.csv', $report)
file:write-text should do the job. An alternative is to use the serialization method 'text':
file:write($path, $value, map { 'method': 'text })
Hope this helps, Christian