title: MVC HttpContext.Response.Write() vs Content()
body: <p>I've seen these two ways to send xml as a client response.</p>
  
  <p>Option 1:</p>
  
  <pre><code>var context = System.Web.HttpContext.Current;
              context.Response.Clear();
              context.Response.Write(sw.ToString());
              context.Response.ContentType = "text/xml";
              context.Response.End();
  </code></pre>
  
  <p>Option 2:</p>
  
  <p><code>return Content(sw.ToString(), "text/xml");</code></p>
  
  <p>Option 2 is way more convenient but are there any advantages in one over the other like performance, security etc.? Which one is preferred (best practice) ?</p>