title: Custom section in App.Config: How to realize this structure in C#?
body: <p>I have created a custom configuration section for my <code>App.Config</code> file, right now it looks like this:</p>
  
  <pre><code>&lt;mySection&gt;
    &lt;myCollection&gt;
      &lt;element name="1" /&gt;
      &lt;element name="2" /&gt;
    &lt;/myCollection&gt;
  &lt;/mySection&gt;
  </code></pre>
  
  <p>As the naming suggests, I have classes inherited from <code>ConfigurationSection</code> (<code>MySection</code>), <code>ConfigurationElementCollection</code> (<code>MyCollection</code> with <code>AddItemName="element"</code> set in the attributes of <code>MySection</code>), and <code>ConfigurationElement</code>. But I wonder how I can realize a structure similar to the following:</p>
  
  <pre><code>&lt;mySection&gt;
    &lt;myElements&gt;
      &lt;element name="1" /&gt;
      &lt;element name="2" /&gt;
      &lt;additionalInfo&gt;"..."&lt;/additionalInfo&gt;
    &lt;/myElements&gt;
    &lt;someOtherSetting option="blub" /&gt;
  &lt;/mySection&gt;
  </code></pre>
  
  <p>Can I still use <code>ConfigurationElementCollection</code> for <code>MyElements</code> or do I have to use something else, as there is not just the <code>element</code> tag (specified by <code>AddItemName="element"</code> in the <code>MySection</code> class), but also another one? If not, what is the class to use here?</p>
  
  <p>And I guess having something between the tags has to just correspond to a property of some <code>AdditionalInfo</code> class, so that it'd be equivalent to the following?</p>
  
  <pre><code>&lt;additionalInfo content="..." /&gt;
  </code></pre>
  
  <p>As for <code>someOtherSetting</code> I guess I could just add another property to <code>MySection</code> corresponding to this, but I didn't get to testing that yet.</p>