Hi, Currently when I need to batch a database for processing I do something like this: for $record at $p in $recordSet where ($p ge $start) and ($p ge $end) return $record/process-record(.) I can imagine why this is more efficient. in BaseX, than using an XPath filter expression, as in $recordSet[position() ge $start and position() le $end]/process-record(.) (which is what I might prefer to do in other environments). But is the 'where' clause the best I can do? XQuery 3.0 has tumbling windows. I am not iterating over subsequences, but rather selecting one (arbitrary) subsequence from a sequence. What's my best approach to this in BaseX? Thanks, Wendell For example, XQuery 3.0 has tumbling windows. Wendell Piez | http://www.wendellpiez.com XML | XSLT | electronic publishing Eat Your Vegetables _____oo_________o_o___ooooo____ooooooo_^