You assumed that first element have NodeOrder=1 second have NodeOrder=2 and so on. It is true unless you change order by moving documents on cms tree.
Example: We create two documents A and B. On the tree A is before B. Now document A have NodeOrder=1 B have NodeOrder=2. When we put B before A we will get: A have NodeOrder=3 B have NodeOrder=2.
Your solution still works but imagine that we will have more then two documents with node orders 2,3,5,6.