I did a really quick experiment with no time for deeper introspection or thought, so kind of embarrassed to show it, but we learn by doing…
Just fine! I’do it similar. If the following endpoint…
declare %rest:path('test') function local:test() { archive:create('file.xml', serialize(<a/>)) };
…is called…
curl -o tmp.zip "http://localhost:8984/test"
…it should give you a ZIP file with a single XML file.