def attributes(namespace = nil, &block) # :yields: namespace, key, value
      if block_given?
        each_attribute(namespace, &block)
        
      else
        if namespace.nil?
          hash = {}

          each_attribute do | namespace, key, value |
            qualified_name = namespace.empty? ? key : namespace + ':' + key
            hash[qualified_name] = value
          end

          return hash

        else
          return @attributesByNamespace[namespace]
        end
      end
    end
def attributes(namespace = nil, &block) # :yields: namespace, key, value
      if block_given?
        each_attribute(namespace, &block)
        
      else
        if namespace.nil?
          hash = {}

          each_attribute do | namespace, key, value |
            qualified_name = namespace.empty? ? key : namespace + ':' + key
            hash[qualified_name] = value
          end

          return hash

        else
          return @attributesByNamespace[namespace]
        end
      end
    end
Returns a Hash of the attributes of the specified +namespace+ (default is all) or enumerates
 them.

   tag.attributes # => { "length" => 123, "width" = 25.4, "orig:color" => "gray" }
   tag.attributes("orig") do |namespace, key, value|
     p "#{namespace}:#{key} = #{value}"
   end

 _namespace_::
 namespace of the returned attributes. If nil, all attributes are returned with
 qualified names (e.g. "meat:color"). If "", attributes of the default namespace are returned.