def add_element element, attrs=nil
      raise "First argument must be either an element name, or an Element object" if element.nil?
      el = @elements.add(element)
      attrs.each do |key, value|
        el.attributes[key]=value
      end	if attrs.kind_of? Hash
      el
    end
def add_element element, attrs=nil
      raise "First argument must be either an element name, or an Element object" if element.nil?
      el = @elements.add(element)
      attrs.each do |key, value|
        el.attributes[key]=value
      end	if attrs.kind_of? Hash
      el
    end
Elements                                      

 Adds a child to this element, optionally setting attributes in
 the element.
 element::
   optional.  If Element, the element is added.
   Otherwise, a new Element is constructed with the argument (see
   Element.initialize).
 attrs::
   If supplied, must be a Hash containing String name,value
   pairs, which will be used to set the attributes of the new Element.
 Returns:: the Element that was added
  el = doc.add_element 'my-tag'
  el = doc.add_element 'my-tag', {'attr1'=>'val1', 'attr2'=>'val2'}
  el = Element.new 'my-tag'
  doc.add_element el