The sum() function converts the nodes in the argument node-set to numbers and then totals those numbers.
Syntax:
number sum(node-set)
Arguments:
Must be a node-set. The nodes are converted to numbers using the rules of the number() function.
Result:
A number, the sum of the values of all the nodes. If any of the nodes cannot be converted into numbers, the result is NaN. If the node-set is empty, the result is zero.