The fn:count function returns the number of values in a sequence.
>>-fn:count(sequence-expression)-------------------------------><
If sequence-expression is not the empty sequence, the number of values in sequence-expression is returned. If sequence-expression is the empty sequence, 0 is returned.
The following function returns the number of items in the sequence (5, 1.0E2, 40.5):
fn:count((5, 1.0E2, 40.5))
The returned value is 3.