code: private void getLastChild() {
  
          // nodekey of the root of the current subtree
          final long parent = getNode().getDataKey();
  
          // traverse tree in pre order to the leftmost leaf of the subtree and
          // push
          // all nodes to the stack
          if (((ITreeStructData)getNode()).hasFirstChild()) {
              while (((ITreeStructData)getNode()).hasFirstChild()) {
                  mStack.push(getNode().getDataKey());
                  moveTo(((ITreeStructData)getNode()).getFirstChildKey());
              }
  
              // traverse all the siblings of the leftmost leave and all their
              // descendants and push all of them to the stack
              while (((ITreeStructData)getNode()).hasRightSibling()) {
                  mStack.push(getNode().getDataKey());
                  moveTo(((ITreeStructData)getNode()).getRightSiblingKey());
                  getLastChild();
              }
  
              // step up the path till the root of the current subtree and process
              // all
              // right siblings and their descendants on each step
              if (getNode().hasParent() && (getNode().getParentKey() != parent)) {
  
                  mStack.push(getNode().getDataKey());
                  while (getNode().hasParent() && (getNode().getParentKey() != parent)) {
  
                      moveTo(getNode().getParentKey());
  
                      // traverse all the siblings of the leftmost leave and all
                      // their
                      // descendants and push all of them to the stack
                      while (((ITreeStructData)getNode()).hasRightSibling()) {
  
                          moveTo(((ITreeStructData)getNode()).getRightSiblingKey());
                          getLastChild();
                          mStack.push(getNode().getDataKey());
                      }
                  }
  
                  // set transaction to the node in the subtree that is last in
                  // document
                  // order
                  moveTo(mStack.pop());
              }
          }
      }
docs: Moves the transaction to the node in the current subtree, that is last in
  document order and pushes all other node key on a stack. At the end the
  stack contains all node keys except for the last one in reverse document
  order.