How to nest params using Nokogiri
<p>I want to create XML like this:</p>

<pre><code>&lt;categories&gt;
 &lt;category id=1&gt;Sound&lt;/category&gt;
 &lt;category id=2 parentId=1&gt;Speakers&lt;/category&gt;
&lt;/categories&gt;
</code></pre>

<p>I used:</p>

<pre><code>   require 'nokogiri'
    @builder = Nokogiri::XML::Builder.new do |xml|
      xml.root {
        xml.categories{
           Category.all.each do |c|
             xml.category# here i should insert my needs

      end
    }
  }
end
</code></pre>

<p>I used an example from "<a href="http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Builder" rel="nofollow">docs about Tag Attribute Short Cuts</a>" but it gave me <code>class</code> and <code>id</code> instead what I want.</p>

<p>How do I do it properly?</p>