title: How shall empty XML elements be handled?
body: <p>I'm not this familiar with XML so maybe you're able to help me :-)</p>
  
  <p>Let's say we have a very simple XML document like this one:</p>
  
  <pre><code>&lt;person&gt;
    &lt;firstname&gt;John&lt;/firstname&gt;
    &lt;middlename/&gt;
    &lt;familyname&gt;Doe&lt;/familyname&gt;
  &lt;/person&gt;
  </code></pre>
  
  <p>So, apparently John Doe does not have a middle name. In an xsd file this element is defined as optional with minOccurs=0.</p>
  
  <p>Are there any rules, standards, best practices or whatsoever that define how to handle this empty element? If minOccurs=0 is defined for an element, shall it be removed? Empty elements have, in my opinion, no use except if attributes are used along with that element.</p>
  
  <p>Thanks,
  Robert</p>