title: How can I remove xmlns:xsi and xmlns:xsd in the return xml in .net core?
body: <p>Here is my code:</p>
  
  <pre><code>[HttpPost]
  [Produces("application/xml")]
  public async Task&lt;xml&gt; mp([FromBody]xml XmlData)
  {
      xml ReturnXmlData = null;
      ReturnXmlData = new xml()
      {
          ToUserName = XmlData.FromUserName,
          FromUserName = XmlData.ToUserName,
          CreateTime = XmlData.CreateTime,
          MsgType = "text",
          Content = "Hello world"
      };
      return ReturnXmlData;
  }
  [XmlRoot("xml")]
  public class xml
  {
      public string ToUserName { get; set; }
      public string FromUserName { get; set; }
      public string CreateTime { get; set; }
      public string MsgType { get; set; }
      public string MsgId { get; set; }
      public string Content { get; set; }
  }
  </code></pre>
  
  <p>Now after I post these code to the local server which for test:</p>
  
  <pre><code>&lt;xml&gt;
    &lt;ToUserName&gt;123&lt;/ToUserName&gt;
    &lt;FromUserName&gt;45&lt;/FromUserName&gt;
    &lt;CreateTime&gt;12345678&lt;/CreateTime&gt;
    &lt;MsgType&gt;text&lt;/MsgType&gt;
    &lt;Content&gt;greating&lt;/Content&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>Then it will return these:</p>
  
  <pre><code>&lt;xml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;ToUserName&gt;45&lt;/ToUserName&gt;
    &lt;FromUserName&gt;123&lt;/FromUserName&gt;
    &lt;CreateTime&gt;20190921203758&lt;/CreateTime&gt;
    &lt;MsgType&gt;text&lt;/MsgType&gt;
    &lt;Content&gt;Hello world&lt;/Content&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>Well, as you see. The XML data contains xmlns:xsi and xmlns:xsd which are not allowed in the remote server.</p>
  
  <p>In addition, the remote server is not control by us that I can't change any code or any rules with it.</p>
  
  <p>That means I have to modify the return XML like this:</p>
  
  <pre><code>&lt;xml&gt;
    &lt;ToUserName&gt;45&lt;/ToUserName&gt;
    &lt;FromUserName&gt;123&lt;/FromUserName&gt;
    &lt;CreateTime&gt;20190921203758&lt;/CreateTime&gt;
    &lt;MsgType&gt;text&lt;/MsgType&gt;
    &lt;Content&gt;Hello world&lt;/Content&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>How can I remove the xmlns:xsi and xmlns:xsd when returns the XML? Thank you.</p>