title: Using MVC 4 Web API, how do I change the format of the ArrayOf node when returning an array in XML
body: <p>I want to control the output of the root node when returning <code>IEnumerable&lt;T&gt;</code>. Currently, I get an <code>&lt;ArrayOf_&gt;</code> node as the root:</p>
  
  <pre><code>&lt;ArrayOfMyClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;MyClass&gt;
              &lt;Number&gt;1&lt;/Number&gt;
      &lt;/MyClass&gt;
      &lt;MyClass&gt;
              &lt;Number&gt;2&lt;/Number&gt;
      &lt;/MyClass&gt;
  &lt;/ArrayOfMyClass&gt;
  </code></pre>
  
  <p>I want to be able to change this to something else (and for that matter, without a namespace):</p>
  
  <pre><code>&lt;NewRoot&gt;
      &lt;MyClass&gt;
              &lt;Number&gt;1&lt;/Number&gt;
      &lt;/MyClass&gt;
      &lt;MyClass&gt;
              &lt;Number&gt;2&lt;/Number&gt;
      &lt;/MyClass&gt;
  &lt;/NewRoot&gt;
  </code></pre>
  
  <p>I don't want to create a group class, because although this would work for XML, I don't want the group class collection property in my JSON output:</p>
  
  <pre><code>{
      "ListOfMyClass": [
          {
              "Number": 1
          },
          {
              "Number": 2
          }
      ]
  }
  </code></pre>
  
  <p>Instead I want to keep it as it would be by default:</p>
  
  <pre><code>[
      {
          "Number": 1
      },
      {
          "Number": 2
      }
  ]
  </code></pre>
  
  <p>I realise there are a few similar questions that have appear to have been answered but all them lead me to a dead end. I could also hack the result myself (yuck), but I'm hoping there is a best-practice way to do this with the stuff provided; annotations, formatters etc.</p>
  
  <p>Has anyone had any success with this whilst leaving the JSON output as the default?</p>