code: public static NodeSequence limit( NodeSequence sequence,
                                        Limit limitAndOffset ) {
          if (sequence == null) return emptySequence(0);
          if (limitAndOffset != null && !limitAndOffset.isUnlimited()) {
              final int limit = limitAndOffset.getRowLimit();
              // Perform the skip first ...
              if (limitAndOffset.isOffset()) {
                  sequence = skip(sequence, limitAndOffset.getOffset());
              }
              // And then the offset ...
              if (limit != Integer.MAX_VALUE) {
                  sequence = limit(sequence, limit);
              }
          }
          return sequence;
      }
docs: Create a sequence of nodes that skips a specified number of nodes before returning any nodes and that limits the number of
  nodes returned.
  
  @param sequence the original sequence that is to be limited; may be null
  @param limitAndOffset the specification of the offset and limit; if null this method simply returns <code>sequence</code>
  @return the limitd sequence of nodes; never null