code: @Override
      public XMLEvent peek() throws XMLStreamException {
          final long currNodeKey = mAxis.getNode().getDataKey();
          try {
              if (mCloseElements) {
                  mRtx.moveTo(mStack.peek());
                  emitEndTag();
              } else {
                  final int nodeKind = mRtx.getNode().getKind();
                  if (((ITreeStructData)mRtx.getNode()).hasFirstChild()) {
                      mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getFirstChildKey());
                      emitNode();
                  } else if (((ITreeStructData)mRtx.getNode()).hasRightSibling()) {
                      mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getRightSiblingKey());
                      processNode(nodeKind);
                  } else if (((ITreeStructData)mRtx.getNode()).hasParent()) {
                      mRtx.moveTo(mRtx.getNode().getParentKey());
                      emitEndTag();
                  }
              }
  
              mRtx.moveTo(currNodeKey);
          } catch (final TTIOException exc) {
              throw new XMLStreamException(exc);
          }
          return mEvent;
      }
docs: {@inheritDoc}