title: How to open, parse and process XML file with Ox gem like with Nokogiri gem?
body: <p>I want to open an external XML file, parse it and use the data to store in my database. I do this with Nokogiri quite easy:</p>
  
  <pre><code>file = '...external.xml'
  xml = Nokogiri::XML(open(file))
  
  xml.xpath('//Element').each do |element|
    # process elements and save to Database e.g.:
    @data = Model.new(:attr =&gt; element.at('foo').text)
    @data.save      
  end
  </code></pre>
  
  <p>Now I want to try the (maybe faster) Ox gem (<a href="https://github.com/ohler55/ox" rel="nofollow">https://github.com/ohler55/ox</a>) - but I do not get how to open and process a file from the documentary. </p>
  
  <p>Any equivalent code examples for the above code would be awesome! Thank you!</p>