Writing XML in Razor

On one of our recent projects, we needed to add a feature to a client’s website that would dynamically generate XML in a Razor CSHTML file. In order to do this, we first needed to tell razor that we’re writing XML, which we did by quite simply writing code to set Response.ContentType to XML’s MIME…