title: Get all attributes for elements in XML file
body: <p>I'm trying to parse a file and get all of the attributes for each <code>&lt;row&gt;</code> tag in the file. The file looks generally like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" standalone="yes"?&gt;
  &lt;report&gt;
    &lt;table&gt;
      &lt;columns&gt;
        &lt;column name="month"/&gt;
        &lt;column name="campaign"/&gt;
        &lt;!-- many columns --&gt;
      &lt;/columns&gt;
      &lt;rows&gt;
    &lt;row month="December 2009" campaign="Campaign #1" 
         adgroup="Python" preview="Not available" 
         headline="We Write Apps in Python" 
         and="many more attributes here" /&gt;
    &lt;row month="December 2009" campaign="Campaign #1" 
         adgroup="Ruby" preview="Not available" 
         headline="We Write Apps in Ruby" 
         and="many more attributes here" /&gt;
    &lt;!-- many such rows --&gt;
  &lt;/rows&gt;&lt;/table&gt;&lt;/report&gt;
  </code></pre>
  
  <p>Here is the full file: <a href="http://pastie.org/7268456#2" rel="nofollow">http://pastie.org/7268456#2</a>.</p>
  
  <p>I've looked at every tutorial and answer I can find on various help boards but they all assume the same thing- I'm searching for one or two specific tags and just need one or two values for those tags. I actually have 18 attributes for each <code>&lt;row&gt;</code> tag and I have a mysql table with a column for each of the 18 attributes. I need to put the information into an object/hash/array that I can use to insert into the table with ActiveRecord/Ruby.</p>
  
  <p>I started out using Hpricot; you can see the code (which is not relevant) in the edit history of this question.</p>