$path as xs:string, $options as map(*)? := ()map { },
$entries as item()* := ()
) as xs:base64Binary</pre>
|- valign="top"
| '''Summary'''
|This convenience function creates an archive from all files in the specified directory {{Code|$path}}.<br/>The {{Code|$options}} parameter contains archiving options, and the files to be archived can be limited via {{Code|$entries}}. The format of the two last arguments is identical to {{Function||archive:create}}, but with two additional options are available:
* {{Code|recursive}}: parse all files recursively (default: {{Code|true}}; ignored if entries are specified via the last argument).
* {{Code|root-dir}}: use name of supplied directory as archive root directory (default: {{Code|false}}).
| '''Examples'''
|This example writes the files of a user’s home directory to <code>archive.zip</code>:
<syntaxhighlight pre lang="'xquery"'>
let $zip := archive:create-from('/home/user/')
return file:write-binary('archive.zip', $zip)
</syntaxhighlightpre>
|}
{| width='100%'
|- valign="top"
| width='120' | '''SignaturesSignature'''
|<pre>archive:extract-to(
$path as xs:string, $archive as xs:base64Binary,
$entries as item()* := ()
) as empty-sequence()</pre>
| '''Examples'''
|The following expression unzips all files of an archive to the current directory: