    # File lib/nokogiri/xml/builder.rb, line 266
          def initialize options = {}, root = nil, &block

            if root
              @doc    = root.document
              @parent = root
            else
              namespace     = self.class.name.split('::')
              namespace[-1] = 'Document'
              @doc          = eval(namespace.join('::')).new
              @parent       = @doc
            end

            @context  = nil
            @arity    = nil
            @ns       = nil

            options.each do |k,v|
              @doc.send("#{k}=""#{k}=", v)
            end

            return unless block_given?

            @arity = block.arity
            if @arity <= 0
              @context = eval('self', block.binding)
              instance_eval(&block)
            else
              yield self
            end

            @parent = @doc
          end