# File temp/document.rb, line 69
    def add( child )
      if child.kind_of? XMLDecl
        @children.unshift child
      elsif child.kind_of? DocType
        if @children[0].kind_of? XMLDecl
          @children[1,0] = child
        else
          @children.unshift child
        end
        child.parent = self
      else
        rv = super
        raise "attempted adding second root element to document" if @elements.size > 1
        rv
      end
    end