to_xml(options = {})
Instance Public methods
Returns a string containing an XML representation of its receiver:
{ foo: 1, bar: 2 }.to_xml
# =>
# <?xml version="1.0" encoding="UTF-8"?>
# <hash>
# <foo type="integer">1</foo>
# <bar type="integer">2</bar>
# </hash>
To do so, the method loops over the pairs and builds nodes that depend on
the values. Given a pair key, value:
If value is a hash there's a recursive call with
key as :root