title: how to create hash from xml in rails?
body: <p>I am trying to create hash from xml file </p>
  
  <pre><code>Hash.from_xml &lt;&lt;-EOX
  &lt;user&gt;
    &lt;id&gt;1&lt;/id&gt;
    &lt;user-name&gt;ryan&lt;/user-name&gt;
  &lt;/user&gt; 
  EOX
  </code></pre>
  
  <p>when i use the above code it works fine and gives 
  <code>{ :user =&gt; { :id =&gt; 1, :user_name =&gt; "ryan" } }</code></p>
  
  <p>my problem is I have the xml part as a string</p>
  
  <pre><code>@xml ="&lt;user&gt;&lt;id&gt;1&lt;/id&gt;&lt;user-name&gt;ryan&lt;/user-name&gt;&lt;/user&gt;" 
  </code></pre>
  
  <p>And trying to do following but its not working</p>
  
  <pre><code>Hash.from_xml &lt;&lt;-EOX
    @xml 
  EOX
  </code></pre>