|-
| '''Examples'''
|All mp3 files from a directory are zipped and written to a file, along with an info file:
<syntaxhighlight lang="xquery">
let $files := file:children('music')[ends-with(., 'mp3')]
return archive:write(
'music.zip',
('info.txt', $files ! file:name(.)), ('Archive with MP3 files', $files ! file:read-binary(.))
)
</syntaxhighlight>