title: XML attribute vs XML element
body: <p>At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process we have been discussing with the team of the other application about the structure of the XML file. </p>
  
  <p>The sample I came up with is essentially something like:</p>
  
  <pre><code>&lt;INVENTORY&gt;
     &lt;ITEM serialNumber="something" location="something" barcode="something"&gt;
        &lt;TYPE modelNumber="something" vendor="something"/&gt; 
     &lt;/ITEM&gt;
  &lt;/INVENTORY&gt;
  </code></pre>
  
  <p>The other team said that this was not industry standard and that attributes should only be used for meta data. They suggested:</p>
  
  <pre><code>&lt;INVENTORY&gt;
     &lt;ITEM&gt;
        &lt;SERIALNUMBER&gt;something&lt;/SERIALNUMBER&gt;
        &lt;LOCATION&gt;something&lt;/LOCATION&gt;
        &lt;BARCODE&gt;something&lt;/BARCODE&gt;
        &lt;TYPE&gt;
           &lt;MODELNUMBER&gt;something&lt;/MODELNUMBER&gt;
           &lt;VENDOR&gt;something&lt;/VENDOR&gt;
        &lt;/TYPE&gt;
     &lt;/ITEM&gt;
  &lt;/INVENTORY&gt;
  </code></pre>
  
  <p>The reason I suggested the first is that the size of the file created is much smaller. There will be roughly 80000 items that will be in the file during transfer. Their suggestion in reality turns out to be three times larger than the one I suggested. I searched for the mysterious "Industry Standard" that was mentioned, but the closest I could find was that XML attributes should only be used for meta data, but said the debate was about what was actually meta data.</p>
  
  <p>After the long winded explanation (sorry) how do you determine what is meta data, and when designing the structure of an XML document how should you decide when to use an attribute or an element?</p>