I am creating a REST service using asp.net mvc4 web api. My service returns xml as output. I want to change some apsects of the xml response including: - The xml root node - Add namespaces - Remove xsi:nil in the xml I am using a datacontext file (Linq to sql dbml file) in my model and not a user defined class. I have read from this link http://www.asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization that I can use DataContract to do so but don't know how to implement that in my case. I do not want to use message handlers since this will require loading the entire xml in a string and might affect performance regarding that the xml output returned might be big
please help...