title: How to create xml from a template-c#
body: <p>I have a xml template like this</p>
  
  <pre><code>&lt;User&gt;
  &lt;UserId&gt;&lt;/UserId&gt;
  &lt;UserName&gt;&lt;/UserName&gt;
  &lt;Roles&gt;
  &lt;Role&gt;&lt;/Role&gt;
  &lt;Roles&gt;&lt;/Role&gt;
  &lt;/Roles&gt;
  &lt;/User&gt;
  </code></pre>
  
  <p>Form this xml template file,dynamicaly i want to generate an xml.How can i do this.</p>
  
  <p>Output xml should look like this</p>
  
  <pre><code>&lt;User&gt;
  &lt;UserId&gt;user1&lt;/UserId&gt;
  &lt;UserName&gt;fr&lt;/UserName&gt;
  &lt;Roles&gt;
  &lt;Role&gt;abc&lt;/Role&gt;
  &lt;Role&gt;def&lt;/Role&gt;
  &lt;/Roles&gt;
  &lt;/User&gt;
  </code></pre>
  
  <p>How can i achieve this.What all changes i need to make in template file.How to read and create xml from this tempalte xml file using c#.</p>