A a = new A();
a.m = 10;
string urlPath = HttpContext.Current.Request.ApplicationPath;
string _file = HttpContext.Current.Server.MapPath(String.Format("{0}/{1}.xml",urlPath,Guid.NewGuid()));
XmlSerializer ser = new XmlSerializer(typeof(A));
TextWriter wr = new StreamWriter(_file, false,Encoding.UTF8);
ser.Serialize(wr,a);
wr.Close();
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.WriteFile(_file);
string httpHeader="attachment;filename=drawout.xml";
response.AppendHeader("Content-Disposition", httpHeader);
response.End();