title: Adding attributes to an XML node
body: <p>How can I create an xml file dynamically, with the following structure?</p>
  
  <pre><code>&lt;Login&gt;
    &lt;id userName="Tushar" passWord="Tushar"&gt;
        &lt;Name&gt;Tushar&lt;/Name&gt;
        &lt;Age&gt;24&lt;/Age&gt;
    &lt;/id&gt;
  &lt;/Login&gt;
  </code></pre>
  
  <p>I am not able to create the attributes inside the <code>id</code> tag (i.e. userName="" and  passWord="").</p>
  
  <p>I am using C# in a windows application.</p>
  
  <p>Some Important namespace that you might require is </p>
  
  <pre><code>using System.Xml;
  using System.IO;
  </code></pre>