title: WebAPI mapping classes as xml
body: <p>I am defining new contract for my WEB API where I want to have specific XML formatting so it can accept the XML below, which I want to parse into my classes classes below. The JSON format maps exactly how I expected, but XML is not.</p>
  
  <p><strong>How do I stop generating "Members" wrapper node in XML?</strong> </p>
  
  <p>The XML I want to parse into classes:</p>
  
  <pre><code>&lt;MembersUpdate&gt;
  &lt;NotificationUrl&gt;http://yoururl/member/profile/&lt;/NotificationUrl&gt;
  &lt;Timestamp &gt;2017-04-11T12:13:35.6516915Z&lt;/Timestamp&gt;
  &lt;Member&gt;
      &lt;MemberId&gt;0&lt;/MemberId&gt;
      &lt;LastUpdated&gt;0001-01-01T00:00:00&lt;/LastUpdated&gt;
  &lt;/Member&gt;
  &lt;Member&gt;
      &lt;MemberId&gt;0&lt;/MemberId&gt;
      &lt;LastUpdated&gt;0001-01-01T00:00:00&lt;/LastUpdated&gt;
  &lt;/Member&gt;
  &lt;Member&gt;
      &lt;MemberId&gt;0&lt;/MemberId&gt;
      &lt;LastUpdated&gt;0001-01-01T00:00:00&lt;/LastUpdated&gt;
  &lt;/Member&gt;
  &lt;Member&gt;
      &lt;MemberId&gt;0&lt;/MemberId&gt;
      &lt;LastUpdated&gt;0001-01-01T00:00:00&lt;/LastUpdated&gt;
  &lt;/Member&gt;
  &lt;/MembersUpdate&gt;
  </code></pre>
  
  <p>Mapping classes:</p>
  
  <pre><code>    /// &lt;remarks/&gt;
  [DataContract]
  public partial class MembersUpdate
  {
      /// &lt;remarks/&gt;
      [DataMember]
      public string NotificationUrl { get; set; }
  
      /// &lt;remarks/&gt;
      [DataMember]
      public System.DateTime Timestamp { get; set; }
  
      /// &lt;remarks/&gt;
      [DataMember]
      public MembersUpdateMember[] Member { get; set; }
  }
  
  /// &lt;remarks/&gt;
  [DataContract]
  public partial class MembersUpdateMember
  {
      /// &lt;remarks/&gt;
      [DataMember]
      public byte MemberId { get; set; }
  
      /// &lt;remarks/&gt;
      [DataMember]
      public System.DateTime LastUpdated { get; set; }
  }
  </code></pre>
  
  <p>However the example rendered does have additional node, and my original XML cannot be parsed. I have added sample rendered for the structure below:</p>
  
  <pre><code>&lt;MembersUpdate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CivicaSystemsLtd.Areas.Notices.ApiControllers"&gt;
        &lt;Member&gt;
          &lt;MembersUpdateMember&gt;
            &lt;LastUpdated&gt;2017-04-11T23:58:06.6310087+01:00&lt;/LastUpdated&gt;
            &lt;MemberId&gt;64&lt;/MemberId&gt;
          &lt;/MembersUpdateMember&gt;
          &lt;MembersUpdateMember&gt;
            &lt;LastUpdated&gt;2017-04-11T23:58:06.6310087+01:00&lt;/LastUpdated&gt;
            &lt;MemberId&gt;64&lt;/MemberId&gt;
          &lt;/MembersUpdateMember&gt;
        &lt;/Member&gt;
        &lt;NotificationUrl&gt;sample string 1&lt;/NotificationUrl&gt;
        &lt;Timestamp&gt;2017-04-11T23:58:06.6300095+01:00&lt;/Timestamp&gt;
      &lt;/MembersUpdate&gt;
  </code></pre>