The function call <code>[[Map Module#map:get|map:get($map, $key)]]</code> can be used to retrieve the value associated with a given key.
A ''map'' can also be viewed as a function from keys to associated values. To achieve this, a map is also a function item. The function corresponding to the map has the signature {{Code|function($key as xs:anyAtomicType) as item()*}}. Calling the function has the same effect as calling the {{Code|get}} function: the expression {{Code|$map($key)}} returns the same result as {{Code|map:get($map, $key)}}. For example, if {{Code|$books-by-isbn}} is a map whose keys are ISBNs and whose associated values are {{Code|book}} elements, then the expression {{Code|$books-by-isbn("0470192747")}} returns the {{Code|book}} element with the given ISBN. The fact that a map is a function item allows it to be passed as an argument to higher-order functions that expect a function item as one of their arguments. As an example, the following query uses the higher-order function {{Code|fn:map($f, $seq)}} to extract all bound values from a ''map'':
<pre class="brush:xquery">
This returns some permutation of {{Code|(42, 'baz', 456)}}.
Like all other values, ''maps'' are immutable. For example, the <code>[[Map Module#map:remove|map:remove]]</code> function creates a new map by removing an entry from an existing map, but the existing map is not changed by the operation.
Like sequences, ''maps'' have no identity. It is meaningful to compare the contents of two maps, but there is no way of asking whether they are "the same map": two maps with the same content are indistinguishable.
Because a map is a function item, functions that apply to functions also apply to maps. A map is an anonymous function, so {{Code|fn:function-name}} returns the empty sequence; {{Code|fn:function-arity}} always returns {{Code|1}}.