<syntaxhighlight lang="xquery">
map { }, (: empty map :)
map { 'key': true(), 1984: (<a/>, <b/>) }, (: map with two entries :)
<syntaxhighlight lang="xquery">
let $map := map { 'foo': 42, 'bar': 'baz', 123: 456 }
return fn:for-each(map:keys($map), $map)