title: Custom Xml Serializer for a specific type in asp.net web api
body: <p>I am in asp.net web api. In an API method, I am calling an external web service, that returns XML response. I don't want to deserialize it. I would rather like to send it to the client as is. Initially, I am storing the response in <code>XDocument</code> object but when my client specifies <code>application/xml</code> as accept header, I see the following exception</p>
  
  <pre><code>Type 'System.Xml.Linq.XDeclaration' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.
  </code></pre>
  
  <p>How do I get around this problem</p>