         var parentOfCurrentNode:Object;
         var parentStack:Array = getParentStack(current);
         var isBefore:Boolean = false;
+        var parentOfChangingNodeIndex:int;
+        var isOurAncestorChanging:Boolean;
+        var bookmarkInChangingCollection:CursorBookmark;
 
         // remember the current parent
         parentOfCurrentNode = parentStack[parentStack.length - 1];

                        }
                    }
                    else {
                        var parentOfChangingNodeIndex:int = parentStack.indexOf(parentOfChangingNode);
                        var isOurAncestorChanging:Boolean = parentOfChangingNodeIndex != -1;
                        if (isOurAncestorChanging)
                        {
                            if (changingNodeAndSiblings != null)
                            {
                                var changingNodeCollectionIndex:int = parentOfChangingNodeIndex + 1;
                                changingCollectionCursor = changingNodeAndSiblings.createCursor();
                                var bookmarkInChangingCollection:CursorBookmark = parentBookmarkStack[changingNodeCollectionIndex];
                                try
                                {
                                    changingCollectionCursor.seek(bookmarkInChangingCollection);

                        }
                    }
                    else {
                        parentOfChangingNodeIndex = parentStack.indexOf(parentOfChangingNode);
                        isOurAncestorChanging = parentOfChangingNodeIndex != -1;
                        if (isOurAncestorChanging)
                        {
                            if (changingNodeAndSiblings != null)
                            {
                                var changingNodeCollectionBookmarkIndex:int = parentOfChangingNodeIndex + 1;
                                changingCollectionCursor = changingNodeAndSiblings.createCursor();
                                bookmarkInChangingCollection = parentBookmarkStack[changingNodeCollectionBookmarkIndex];
                                try
                                {
                                    changingCollectionCursor.seek(bookmarkInChangingCollection);
