title: How to convert xml to a map in Elixir?
body: <p>Rails extends Hash with from_xml</p>
  
  <pre><code>xml = &lt;&lt;-XML
    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;hash&gt;
        &lt;foo type="integer"&gt;1&lt;/foo&gt;
        &lt;bar type="integer"&gt;2&lt;/bar&gt;
      &lt;/hash&gt;
  XML
  
  hash = Hash.from_xml(xml)
  # =&gt; {"hash"=&gt;{"foo"=&gt;1, "bar"=&gt;2}}
  </code></pre>
  
  <p>I'm struggling to find any examples for how to do this in Elixir in a comparably easy way.</p>
  
  <p>Something like:</p>
  
  <pre><code>Map.from_xml(xml)
  # =&gt; %{"hash" =&gt; %{"foo" =&gt; 1, "bar" =&gt; 2}}
  </code></pre>