Basic XQuery equivalents of map, fold, and filter functions adapted from the standard library of the Scheme programming language. Demonstrates the use of higher-order functions in eXist.
sequences:filter($func as function, $seq as item()*)
as item()*
Filters the passed sequence by calling $func for every item. All items for which $func returns true are copied to the output sequence, items for which it returns false are skipped.