title: XML Serialization of member variable as xmlnode
body: <p>I have some XML which I would like to serialize into a class.</p>
  
  <pre><code>&lt;Group&gt;
   &lt;Employees&gt;
       &lt;Employee&gt;
           &lt;Name&gt;Hari&lt;/Name&gt;
           &lt;Age&gt;30&lt;/Age&gt;
       &lt;/Employee&gt;
       &lt;Employee&gt;
           &lt;Name&gt;Yougov&lt;/Name&gt;
           &lt;Age&gt;31&lt;/Age&gt;
       &lt;/Employee&gt;
       &lt;Employee&gt;
           &lt;Name&gt;Adrian&lt;/Name&gt;
           &lt;Age&gt;28&lt;/Age&gt;
       &lt;/Employee&gt;
  &lt;/Employees &gt;
  </code></pre>
  
  <p></p>
  
  <p>The above XML can be realized in C# pretty much easily.
  But I'm stumbled upon my requirement, where the XML looks like,</p>
  
  <pre><code>&lt;Group&gt;
   &lt;Employees&gt;
      &lt;Hari Age=30 /&gt;
      &lt;Yougov Age=31 /&gt;
      &lt;Adrian Age=28 /&gt;
   &lt;/Employees &gt;
  &lt;/Group&gt;
  </code></pre>
  
  <p>Where Employees is a <code>List&lt;Employee&gt;</code> with <code>KeyValuePair&lt;string, int&gt;("Hari", 30)</code> </p>
  
  <p>How do I design the classes and member variables to get the above serialized XML?
  (Provided, there wont be any duplicate names in the employee list)</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>*<a href="https://stackoverflow.com/questions/83232/is-there-a-serializable-generic-key-value-pair-class-in-net">Serializing KeyValuePair</a></p>