@Override
    public SpanNode next() {
        if (stack.isEmpty() || !hasNext()) {
            iteratorFromLastCallToNext = null;
            throw new NoSuchElementException("No next element available.");
        }
        stack.peek().traversed = false;
        iteratorFromLastCallToNext = stack.peek();
        return stack.peek().next();
    }
ListIterator implementation which performs a depth-first traversal of SpanNodes.

@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/main/java/com/yahoo/document/annotation/RecursiveNodeIterator.java