# File lib/active_support/xml_mini/nokogiri.rb, line 35 def to_hash(hash = {}) attributes = attributes_as_hash if hash[name] hash[name] = [hash[name]].flatten hash[name] << attributes else hash[name] ||= attributes end children.each { |child| next if child.blank? && 'file' != self['type'] if child.text? || child.cdata? (attributes[CONTENT_ROOT] ||= '') << child.content next end child.to_hash attributes } hash end