code: @Override
      public String getElementText() throws XMLStreamException {
  
          final long nodeKey = mAxis.getNode().getDataKey();
  
          /*
           * The cursor has to move back (once) after determining, that a closing
           * tag would be the next event (precond: closeElement and either goBack
           * or goUp is true).
           */
          if (mCloseElements && (mGoBack || mGoUp)) {
              if (mGoUp) {
                  mAxis.moveTo(mLastKey);
                  mGoUp = false;
              } else if (mGoBack) {
                  mAxis.moveTo(mStack.peek());
                  mGoBack = false;
              }
          }
  
          if (mEvent.getEventType() != XMLStreamConstants.START_ELEMENT) {
              mAxis.moveTo(nodeKey);
              throw new XMLStreamException("getElementText() only can be called on a start element");
          }
          final FilterAxis textFilterAxis =
              new FilterAxis(new DescendantAxis(mRtx), mRtx, new TextFilter(mRtx));
          final StringBuilder strBuilder = new StringBuilder();
  
          while (textFilterAxis.hasNext()) {
              textFilterAxis.next();
              strBuilder.append(mRtx.getValueOfCurrentNode());
          }
  
          try {
              mRtx.moveTo(nodeKey);
          } catch (TTIOException exc) {
              throw new XMLStreamException(exc);
          }
          return strBuilder.toString();
      }
docs: {@inheritDoc}