code: @Override
      public boolean hasNext() {
  
          resetToLastKey();
  
          if (mFirst) {
              mFirst = false;
              if (mFrom.hasNext() && Type.getType(mFrom.getNode().getTypeKey()).derivesFrom(Type.INTEGER)) {
                  mStart = Integer.parseInt(new String(((ITreeValData)mFrom.getNode()).getRawValue()));
  
                  if (mTo.hasNext() && Type.getType(mTo.getNode().getTypeKey()).derivesFrom(Type.INTEGER)) {
  
                      mEnd = Integer.parseInt(new String(((ITreeValData)mTo.getNode()).getRawValue()));
  
                  } else {
                      // at least one operand is the empty sequence
                      resetToStartKey();
                      return false;
                  }
              } else {
                  // at least one operand is the empty sequence
                  resetToStartKey();
                  return false;
              }
          }
  
          if (mStart <= mEnd) {
              AtomicValue val =
                  new AtomicValue(TypedValue.getBytes(Integer.toString(mStart)), NamePageHash
                      .generateHashForString("xs:integer"));
  
              final int itemKey = getItemList().addItem(val);
              moveTo(itemKey);
              mStart++;
              return true;
          } else {
              resetToStartKey();
              return false;
          }
      }
docs: {@inheritDoc}