title: How To: Dynamically Creating the XML file content and sending as a text file in asp.net c#
body: <p>hi there i am working on an asp.net web page that first lets users to enter required values to indicated textfields and then generate a new text file according to the data given by the user. </p>
  
  <p>I want to let users receive a "Result.xml" file when they click on "get file" button.</p>
  
  <p>i've searched for that info, i know it must have an easy solution but by now i am out of luck (i must be tired). i tried the following code but it didnt worked: </p>
  
  <pre><code> DataSet ds = new DataSet();
   ds.Tables.Add("TEST");
   ds.writexml("test.xml");
   Response.TransmitFile("test.xml");
  </code></pre>
  
  <p>but the program says it couldnt find any file. also i dont want to "write" a physical file to the server, i just want to send the contents of the dataset as "test.xml" </p>
  
  <p>Please help, 
  Thanks for spending your time. </p>