NodeCollection#add() now returns elements sorted in document order.