I have a WebApi that returns a simple object, but when I\'m forcing it to return as XML (Accept: application/xml) it ignores the [XmlAttribute] att
Accept: application/xml
[XmlAttribute]
This worked for me... no need to change global configuration.
var configuration = new HttpConfiguration(); configuration.Formatters.XmlFormatter.UseXmlSerializer = true; return Request.CreateResponse(HttpStatusCode.OK, myObjectToSerialize, configuration);