title: Dynamically adding textbox value to XML file
body: <p>I want to dynamically create XML file with nodes of the all TextBoxes in the form with theirs values.</p>
  
  <p>Example:</p>
  
  <pre><code>  var xmlNode =
         new XElement("TextBoxes",
                      new XElement("TextBox",
                          new XElement("name", textBox1.Name.ToString())
                      )
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>foreach (TextBox text in this.Controls.OfType&lt;TextBox&gt;())
          {
              var xmlNode =
              new XElement("TextBoxes",
                      new XElement("TextBox",
                          new XElement("name", text.Name.ToString())
                      )
                  );
  
              xmlNode.Save("Test.xml"); 
          }    
  </code></pre>
  
  <p>Any suggestions?</p>