<div dir="ltr">Hi all,<div><br></div><div>Is there an efficient way to transform entries in a map into two arrays, one containing the keys and one containing the values?  Here's my attempt:</div><div><br></div><div>```</div><div>xquery version "3.1";</div><div><br></div><div><div>let $letters-numbers := map { "a": 1, "b": 2, "c": 3 }</div><div>return </div><div>    (</div><div>        array { map:keys($letters-numbers) },</div><div>        array { $letters-numbers?* }</div><div>    )</div></div><div>```</div><div><br></div><div>This successfully takes `map { "a": 1, "b": 2, "c": 3 }` and returns (["a", "b", "c"], [1, 2, 3]), but the way it iterates through the map twice strikes me as somewhat inefficient.  Is there a better way to reduce this to a single pass through the map, or is this actually the best approach?</div><div><br></div><div>Joe</div></div>