                 @closed?()
                 @closed = yes
 
+    onremove: (el) ->
+        el._stream.delete()
+        delete el._stream
+
     onclose: (el) ->
         el._stream.write =>
             unless el.isempty or el is el.builder

        @emit 'open scope', {order:0}
        @released = yes



class StreamAdapter extends Stream # Readable

{ prettify, attrStr } = require './util'

EVENTS = [
    'add', 'close', 'end', 'remove',
    'attr','text', 'raw', 'data'
]

