title: How to create controls dynamically in MVC 3 based on an XML file
body: <p>I have a XML file stored in the database as XML format which contains some controls like drop down text box, label text area, etc. which may or may not have initial values. So my aim is to read the XML file and based on the control type, I need to create that control dynamically and associate the initial value if any and the preview of the page have to be shown in a view.   Anybody please help me how to create the controls dynamically in MVC 3 for this scenario. </p>
  
  <p>For eg: my xml file will look something like this.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
    &lt;controls&gt;
      &lt;control&gt;
        &lt;type name="label"&gt;
          &lt;property name="Visible" value="true"/&gt;
          &lt;property name="ID" value="Label1"/&gt; 
           .
           .
           .
        &lt;/type&gt;
      &lt;/control&gt;
      &lt;control&gt;
        &lt;type name="TextBox"&gt;
          &lt;property name="Visible" value="true"/&gt;
          &lt;property name="ID" value="TextBox1"/&gt;
          .
          .
          .
        &lt;/type&gt;
      &lt;/control&gt;
      .
      .
      .
    &lt;/controls&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>