I have encountered many half-solutions to the task of returning XML in ASP.NET. I don\'t want to blindly copy & paste some code that happens to work most of the time, th
XmlDocument xd = new XmlDocument();
xd.LoadXml(xmlContent);
context.Response.Clear();
context.Response.ContentType = "text/xml";
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
xd.Save(context.Response.Output);
context.Response.Flush();
context.Response.SuppressContent = true;
context.ApplicationInstance.CompleteRequest();