# map:find - XPath XQuery Reference

Searches the supplied input sequence and any contained maps and arrays for a map entry with the supplied key,
            and returns the corresponding values.deterministiccontext-independentfocus-independentThe function map:find searches the sequence supplied as $input
         looking for map entries whose key is the same key
         as $key. The associated value in any such map entry (each being in general a sequence)
         is returned as a member of the result array.The search processes the $input sequence using the following recursively-defined rules 
            (any equivalent algorithm may be used provided it delivers
            the same result, respecting those rules that constrain the order of the result):To process a sequence, process each of its items in order.To process an item that is an array, process each of the array's members in order 
               (each member is, in general, a sequence).To process an item that is a map, then for each key-value entry (K, V)
               in the map (in implementation-dependent order)
               perform both of the following steps, in order:If K is the same key as $key, 
                  then add V as a new member to the end of the result array.Process V (which is, in general, a sequence).To process an item that is neither a map nor an array, do nothing. (Such items are ignored).map:find($responses, 0)['no', 'non', 'nein']map:find($responses, 1)['yes', 'oui', ('ja', 'doch')]map:find($responses, 2)[]map:find($inventory, "parts")[[map{"name":"engine", "id":"YW678", "parts":[]}], []]If $input is an empty sequence, map, or array, or if the requested $key is not found,
            the result will be a zero-length array.