Pp. 154 (no. 183)
This code sample is adapted from Clifford B. Anderson and Joseph C. Wicentowski, XQuery for Humanists (College Station: Texas A&M University Press, 2020), 154. Download this code sample in its raw form. View the source on GitHub.
let $zip-codes :=
<zip-codes city="Nashville">
<zip-code>37027</zip-code>
<zip-code>37210</zip-code>
<zip-code>37209</zip-code>
<zip-code>37212</zip-code>
</zip-codes>
let $city :=$zip-codes/@city
for $zip-code in $zip-codes/zip-code
return
$zip-code/text()