An index can/should never be equal the length of a NodeSet, thus we should use "<" here instead of "<=".