title: How to convert xml file to yaml?
body: <p>Basically questions says it all, how can I convert an xml file to yaml?</p>
  
  <p>I've tried this: </p>
  
  <pre><code>require 'active_support/core_ext/hash/conversions'
  require 'yaml'
  
  file = File.open("data/mconvert.xml", "r")
  hash = Hash.from_xml(file.read)
  yaml = hash.to_yaml
  File.open("data/mirador.yml", "w") { |file| file.write(yaml) }
  </code></pre>
  
  <p>But, I am getting an "Exception parsing" error. I thought that was because I had dashes in an xml tag name, so I replaced the dashes with <code>dashcharacterr</code> But that still didn't work. </p>