title: Rails to_xml, use xml attributes instead of child nodes
body: <p>I've been playing around with rail's to_xml, trying to create a really simple rest interface for a project i'm working on. </p>
  
  <p>So far, i've come up with</p>
  
  <pre><code>cards = Card.all(:conditions =&gt; {:racedate =&gt; Date.today.to_s})
  render :xml =&gt; cards.to_xml(:include =&gt; {:races =&gt; { :only =&gt; [:id, :number, :race_time, :name] } }, :skip_types =&gt; true, :root =&gt; "cards")    
  </code></pre>
  
  <p>in my controller.</p>
  
  <p>This produces some xml.</p>
  
  <pre><code>    &lt;card&gt;
       &lt;country-code&gt;USA&lt;/country-code&gt;
       &lt;id&gt;55&lt;/id&gt;
       &lt;name&gt;Vernon Downs&lt;/name&gt;
       &lt;races&gt;
        &lt;race&gt;
          &lt;id&gt;355&lt;/id&gt;
          &lt;name/&gt;
          &lt;number&gt;1&lt;/number&gt;
          &lt;race-time/&gt;
        &lt;/race&gt;
      &lt;/races&gt;
     &lt;/card&gt;
  </code></pre>
  
  <p>What i'd really like is to use xml attributes rather than child nodes, so it would be </p>
  
  <p><code>&lt;card country-code="USA" id=55 name="Vernon Downs"/&gt;</code> etc. </p>
  
  <p>I've poured over the to_xml api docs but can't seem to find any way of doing this? Do i need to create an xml template and render that way?</p>
  
  <p>Thanks</p>