USING: combinators fry kernel namespaces sequences vectors xml xml.data ; : stack-sax ( stream quot: ( parents xml-elem -- ) -- ) '[ V{ } clone sax-stack [ [ sax-stack get swap [ _ call ] 2keep { { [ dup opener? ] [ swap push ] } { [ dup closer? ] [ drop pop* ] } [ 2drop ] } cond ] sax ] with-variable ] call ;