Possible Duplicate:
What is the best way to return XML from a controller's action in ASP.NET MVC?
I'm able to return JSON and partial views (html) as a valid ActionResult, but how would one return an XML string?
Possible Duplicate:
What is the best way to return XML from a controller's action in ASP.NET MVC?
I'm able to return JSON and partial views (html) as a valid ActionResult, but how would one return an XML string?
You could use return this.Content(xmlString, "text/xml"); to return a built XML string from an action.
For JSON/XML I have written an XML/JSON Action Filter that makes it very easy to tackle without handling special cases in your action handler (which is what you seem to be doing).