title: Ruby Hash & Array to xml
body: <p>I'm using ActiveSupport's to_xml to generate some xml from a hash.</p>
  
  <p>I have need for the this ruby:</p>
  
  <pre><code>:Shipment =&gt; {
    :Packages =&gt; [
      {:weight =&gt; '5', :type =&gt; 'box'},
      {:weight =&gt; '3', :type =&gt; 'tube'}
    ]
  }
  </code></pre>
  
  <p>To generate this xml:</p>
  
  <pre><code>&lt;Shipment&gt;
    &lt;Package&gt;
      &lt;weight&gt;5&lt;/weight&gt;
      &lt;type&gt;box&lt;/type&gt;
    &lt;/Package&gt;
    &lt;Package&gt;
      &lt;weight&gt;3&lt;/weight&gt;
      &lt;type&gt;tube&lt;/type&gt;
    &lt;/Package&gt;
  &lt;/Shipment&gt;
  </code></pre>
  
  <p>But instead, it wraps the array in another set of xml tags like this:</p>
  
  <pre><code>&lt;Shipment&gt;
    &lt;Packages&gt;
      &lt;Package&gt;
        &lt;weight&gt;5&lt;/weight&gt;
        &lt;type&gt;box&lt;/type&gt;
      &lt;/Package&gt;
      &lt;Package&gt;
        &lt;weight&gt;3&lt;/weight&gt;
        &lt;type&gt;tube&lt;/type&gt;
      &lt;/Package&gt;
    &lt;/Packages&gt;
  &lt;/Shipment&gt;
  </code></pre>
  
  <p>Please don't tell me I need to change my xml structure... It's how UPS says to do it :(</p>
  
  <p>Anybody know a work-around?</p>