> The XQuery Processor
FLWORExpr ::= InitialClause Clause* ReturnClause
InitialClause ::= ForClause | LetClause | WindowClause
Clause ::= InitialClause | WhereClause | GroupByClause | OrderByClause | CountClause
The syntax for an outer for clause is the same as for a regular for clause, but with an extra outer keyword prepended before the for keyword.
CountClause ::= "count" "$" VarName
A count clause augments each tuple in it's input tuple stream with an additional variable, named in the clause. The value of this variable is the singleton xs:integer value of the ordinal position of the tuple in the input tuple stream, starting at 1.