title: Using XML::Simple to build XML from an array of hashes with some keys as attributes
body: <p>I am using <a href="http://p3rl.org/XML%3a%3aSimple" rel="nofollow"><code>XML::Simple</code></a> and I wish to convert this data to XML:</p>
  
  <pre><code>@rooms = (
     {
        id =&gt; 4,
        is_key =&gt; 0,
        name =&gt; B507,
        capacity =&gt; 35
     },
     {
        id =&gt; 5,
        is_key =&gt; 1,
        name =&gt; B502,
        capacity =&gt; 24
     }
  );
  </code></pre>
  
  <p>I want to output this:</p>
  
  <pre><code>&lt;rooms&gt;
     &lt;room id=4 is_key=0&gt;
        &lt;name&gt;B507&lt;/name&gt;
        &lt;capacity&gt;35&lt;/capacity&gt;
     &lt;/room&gt;
     &lt;room id=5 is_key=1&gt;
        &lt;name&gt;B502&lt;/name&gt;
        &lt;capacity&gt;24&lt;/capacity&gt;
     &lt;/room&gt;
  &lt;/rooms&gt;
  </code></pre>
  
  <p>I don't see a way to do this with <code>XML::Simple::XMLout</code>. Am I missing something?</p>