title: XML to C# Class Question
body: <p>Can someone please help me, I have this xml snippet</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;EmailConfiguration&gt;
    &lt;DataBoxID&gt;123&lt;/DataBoxID&gt;
    &lt;DefaultSendToAddressCollection&gt;
       &lt;EmailAddress&gt;email@whereEver.com&lt;/EmailAddress&gt;
    &lt;/DefaultSendToAddressCollection&gt;
  &lt;/EmailConfiguration&gt;
  </code></pre>
  
  <p>I want to create a corressponding c# class from this. Before you say - "Just use xsd.exe", the output from Xsd cannot be serialized and deserialized correct, because it generates the class using partial classes. </p>
  
  <p>Please can you tell me how to create this class.... here is the approach I took, but it doesn't work.</p>
  
  <pre><code>public class EmailConfiguration
  {
      private string dataBoxID;
  
      public string DataBoxID
      {
          get { return dataBoxID; }
          set { dataBoxID = value; }
      }
  
      private DefaultSendToAddressCollectionClass defaultSendToAddressCollection;
  
      public DefaultSendToAddressCollectionClass DefaultSendToAddressCollection
      {
          get { return defaultSendToAddressCollection; }
          set { defaultSendToAddressCollection = value; }
      }
  }
  </code></pre>
  
  <p>And here is the class declaration for the subclass</p>
  
  <pre><code>public class DefaultSendToAddressCollectionClass
  {
      private string[] emailAddress;
      public string[] EmailAddress
      {
          get { return emailAddress; }
          set { emailAddress = value; }
      } 
  }
  </code></pre>