title: Best practices for storing html form content in XML document
body: <p>I have two web forms which are filled in by the user. They contain different types of fields: text boxes, radio buttons, check boxes (single or in groups). All the information that user submits I store in XML field in a database. </p>
  
  <p>My question is: <strong>what are the good practices for string that kind of informations in a XML file.</strong> </p>
  
  <p>For now I do like this:</p>
  
  <p><strong>Text boxes</strong>, for example: <code>txtName</code> I put into <code>&lt;Name&gt;John&lt;/Name&gt;</code> tags.</p>
  
  <p><strong>Radio boxes</strong>, for example: <code>rdbSex</code> I put into <code>&lt;Sex&gt;Male&lt;/Sex&gt;</code>. </p>
  
  <p><strong>Check boxes groups</strong> I put into one XML tag and I specify <code>true</code> or <code>false</code> for each check box item, for example:</p>
  
  <pre><code>&lt;favoriteMovies&gt;
      &lt;StarWars&gt;True&lt;/StarWars&gt;
      &lt;KillBill&gt;False&lt;/KillBill&gt;
      ....
  &lt;/favoriteMovies&gt;
  </code></pre>
  
  <p>The movies are stored in the database in one table and each of those have an ID. Should I store it also in the XML file? Like this:</p>
  
  <pre><code>&lt;favoriteMovies&gt;
      &lt;StarWars id="4"&gt;True&lt;/StarWars&gt;
      &lt;KillBill id="6"&gt;False&lt;/KillBill&gt;
      ....
  &lt;/favoriteMovies&gt;
  </code></pre>
  
  <p>or maybe to store only selected choices (withoud KillBill in this case):</p>
  
  <pre><code>&lt;favoriteMovies&gt;
      &lt;StarWars id="4 /&gt;
      ....
  &lt;/favoriteMovies&gt;
  </code></pre>
  
  <p>The same problem is with <strong>dropdown controls</strong>. They are populated from one table in database and each item has an id. Should I store only the id of the user choise, or both: id and name of the choice. So it is better to store do like this:</p>
  
  <pre><code>&lt;Address&gt;
      &lt;City&gt;2&lt;/City&gt;
  &lt;/Address&gt;
  </code></pre>
  
  <p>or like this:</p>
  
  <pre><code>&lt;Address&gt;
      &lt;City id="2" /&gt;
  &lt;/Address&gt;
  </code></pre>
  
  <p>or like this</p>
  
  <pre><code>&lt;Address&gt;
      &lt;City&gt;New York&lt;/City&gt;
  &lt;/Address&gt;
  </code></pre>
  
  <p>The documents are submitted by the user, but they can be reopen and edited, and all the controls on the web site should be repopulated. So it seams I need ID of the city, to select appropriate value in DropDown control, but it makes the XML document less readable.</p>
  
  <p>Are there any recommendations or some documents that specify the rules for storing web forms elements in XML documents?</p>