(define (ifollow nl) ;; Implements ifollow as per ISO/IEC 10179:1996 (node-list-map (lambda (snl) (let loop ((rest (siblings snl))) (cond ((node-list-empty? rest) (empty-node-list)) ((node-list=? (node-list-first rest) snl) (node-list-first (node-list-rest rest))) (else (loop (node-list-rest rest)))))) nl))