title: How do I create C# class model to get XML serialized request in given format?
body: <p>I am designing my class model.  The serialized message of the class model needs to be in this format:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;Request&gt;
    &lt;Name&gt;TesterScript&lt;/Name&gt;
    &lt;ID&gt;CD_20110628133820576&lt;/ID&gt;
    &lt;Type&gt;
      &lt;ItemId&gt;191_20110628T133821&lt;/ItemId&gt;
      &lt;ShopId&gt;MyBCShop&lt;/ShopId&gt;
      &lt;MessageXml&gt;
      &lt;ChildMessage&gt;
        This is my message
      &lt;/ChildMessage&gt;
      &lt;/MessageXml&gt;
    &lt;/Type&gt;
    &lt;SentTime&gt;2011-06-30T15:27:06-07:00&lt;/SentTime&gt;
  &lt;/Request&gt;
  </code></pre>
  
  <p>How would I design the classes?
  Also what should be the best way to serialize the suggested class model to above XML message? I am thinking of using:</p>
  
  <pre><code>// Serialize the request
  XmlSerializer xs = new XmlSerializer(typeof(Request));
  StringWriter sw = new StringWriter();
  xs.Serialize(sw, dispatchRequest);
  string xml = sw.ToString();
  return new xml;
  </code></pre>
  
  <p>Is this the most suitable way?</p>