an XQuery library for computing aggregates over tuples in MarkLogic Server