title: XML::Simple XMLin parsing issues with KeyAttr
body: <p>XML::Simple 2.18<br>
  Perl 5.10</p>
  
  <p>The issue I'm currently having is enforcing how the XML Parser handles single vs. multiples of the 'approver' element. In the XML below, with the single 'approver' element, the parser doesn't fold the element into a subhash (but I need it to do so, for single or multiples). </p>
  
  <pre><code>&lt;ECREQUEST&gt;
    &lt;request event="submit"&gt;
      &lt;form_id&gt;3576&lt;/form_id&gt;
      &lt;status&gt;Initiated&lt;/status&gt;
      &lt;form_fields&gt;
        &lt;form_field_id id="13048" type="text"&gt;
          &lt;value&gt;&lt;![CDATA[jamesj]]&gt;&lt;/value&gt;
        &lt;/form_field_id&gt;
        &lt;form_field_id id="13047" type="text"&gt;
          &lt;value&gt;&lt;![CDATA[jackh]]&gt;&lt;/value&gt;
          &lt;resources&gt;
            &lt;resource name="jackh"&gt;
              &lt;approval_type approver_id="0" name="single"&gt;
                &lt;approvers&gt;
                  &lt;approver name="jackh" reason=""/&gt;
                &lt;/approvers&gt;
              &lt;/approval_type&gt;
            &lt;/resource&gt;
          &lt;/resources&gt;
        &lt;/form_field_id&gt;
      &lt;/form_fields&gt;
    &lt;/request&gt;
  &lt;/ECREQUEST&gt;
  </code></pre>
  
  <p><strong>Data Dumper</strong>:</p>
  
  <pre><code>'approver' =&gt; {
      'name' =&gt; 'zhangj',
      'reason' =&gt; ''
  }
  </code></pre>
  
  <p>But if you add another 'approver' element to the XML, like:</p>
  
  <pre><code>&lt;approvers&gt;
      &lt;approver name="jackh" reason=""/&gt;
      &lt;approver name="jillr" reason=""/&gt;
  &lt;/approvers&gt;
  </code></pre>
  
  <p>then it's parse like: <strong>Data Dumper</strong>:</p>
  
  <pre><code>'approver' =&gt; {
      'jillr' =&gt; {
          'reason' =&gt; ''
      },
      'jackh' =&gt; {
          'reason' =&gt; ''
      }
  }
  </code></pre>
  
  <p>I tried using <code>KeyAttr =&gt; { approver =&gt; "+name" }</code> with the XMLin, which will force multiple 'approver' elements to include the name attribute, but doesn't fix single approver elements...Unfortunately this option then also forces the form_field_id elements to be parsed as arrays instead of nested hashes (which I DON'T want).</p>
  
  <p>How can I force the parser to always create nested hashes, even for single elements?</p>