|-
| width='90' | '''Signatures'''
|{{Func|zip2:extract-binaries|$zip as xs:base64Binary|xs:string*}}<br/>{{Func|zip2:extract-binaries|$zip as xs:base64Binary, $entry-names as xs:string*|xs:stringbase64Binary*}}
|-
| '''Summary'''
for $entry at $p in $entries
return file:write-binary($entry, $contents[$p])
</pre>
|}
==zip2:update==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|zip2:update|$zip as xs:base64Binary, $entries as element(entry)*, $contents as item()*|xs:base64Binary}}
|-
| '''Summary'''
|Adds new entries and replaces existing entries in a zip archive.<br/>The format of {{Code|$entries}} and {{Code|$contents}} is the same as for [[#zip2:create|zip2:create]].
|-
| '''Examples'''
|This example replaces texts in a Word document:
<pre class="brush:xquery">
declare variable $input := "HelloWorld.docx";
declare variable $output := "HelloUniverse.docx";
declare variable $doc := "word/document.xml";
let $archive := file:read-binary($input)
let $entry :=
copy $c := fn:parse-xml(zip2:extract-texts($archive, $doc))
modify replace value of node $c//*[text() = "HELLO WORLD!"] with "HELLO UNIVERSE!"
return fn:serialize($c)
let $updated := zip2:update($archive, <entry>{ $doc }</entry>, $entry)
return file:write-binary($output, $updated)
</pre>
|}