         @isempty = yes
         @content = ""
         @children children, opts
-
-    tag: =>
-        @builder._new_tag this, arguments...
-
-    $tag: =>
-        @builder._new_sync_tag this, arguments...
+        @$tag = sync_tag
+        @tag = new_tag
 
     attr: (key, value) =>
         if typeof key is 'string'

    return tag



class Tag extends EventEmitter
    constructor: (@name, @attrs, children, opts) ->

        @opts.pretty ?= off
        @level = @opts.level ? -1
        @Tag = Tag
        @tag = new_tag
        @$tag = sync_tag

    write: (data) =>
        @emit 'data', data
