class Hash

def from_xml(xml, disallowed_types = nil)

which are Symbol and YAML.
Note that passing custom disallowed types will override the default types,

# => ActiveSupport::XMLConverter::DisallowedType: Disallowed type attribute: "integer"
hash = Hash.from_xml(xml, ['integer'])

XML

"David"
1


xml = <<-XML

array.
Custom +disallowed_types+ can also be passed in the form of an

parse this XML.
type="symbol". Use Hash.from_trusted_xml to
+DisallowedType+ is raised if the XML contains attributes with type="yaml" or

# => {"hash"=>{"foo"=>1, "bar"=>2}}
hash = Hash.from_xml(xml)

XML

2
1


xml = <<-XML

its content
Returns a Hash containing a collection of pairs when the key is the node name and the value is
def from_xml(xml, disallowed_types = nil)
  ActiveSupport::XMLConverter.new(xml, disallowed_types).to_h
end