function last() must return a number equal to the context size of the current node, see http://www.w3.org/TR/xpath/#function-last