def get_attributes(element)
        attributes = {}
        element.attributes.each { |n, v| attributes[n] = v }
        attributes
      end
def get_attributes(element)
        attributes = {}
        element.attributes.each { |n, v| attributes[n] = v }
        attributes
      end
Converts the attributes array of an XML element into a hash.
 Returns an empty Hash if node has no attributes.

 element::
   XML element to extract attributes from.