title: ASP.NET Web API Controller Specific Serializer
body: <p>I've a self host Web API with 2 controllers:</p>
  
  <ul>
  <li>For controller 1, I need default DataContractSerializer (I'm exposing EF 5 POCO)</li>
  <li>For controller 2, I need XmlFormatter with parameter UseXmlSerializer set to true (I'm exposing an XmlDocument)</li>
  </ul>
  
  <p>I've tried to set formatters during controller initialization, but the configuration seems to be global, affecting all controllers:</p>
  
  <pre><code>public class CustomConfigAttribute : Attribute, IControllerConfiguration
  {
      public void Initialize(HttpControllerSettings settings,
      HttpControllerDescriptor descriptor)
      {
          settings.Formatters.XmlFormatter.UseXmlSerializer = true;
  
      }
  }
  </code></pre>
  
  <p>How can I solve this?</p>