title: Having an empty xs:date element being validated OK by the XSD
body: <p>I have this in my XSD:</p>
  
  <pre><code>&lt;xs:element name="End_Date" type="xs:date" minOccurs="0"/&gt;
  </code></pre>
  
  <p>I would like the validation pass if there's a date or if there's an empty node</p>
  
  <p><code>&lt;End_Date&gt;2011-05-31T00:00:00.000&lt;/End_Date&gt;</code>
  should be ok as well as 
  <code>&lt;End_Date&gt;&lt;/End_Date&gt;</code></p>
  
  <p>How can I modifiy the XSD to make it so?</p>
  
  <p>I tried different things:</p>
  
  <p><code>nillable="true"</code></p>
  
  <p>and</p>
  
  <pre><code>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>                    &lt;xs:element name="End_Date"&gt;
                      &lt;xs:simpleType&gt;
                          &lt;xs:union memberTypes="xs:date"&gt;
                          &lt;xs:simpleType&gt;
                          &lt;xs:restriction base="xs:string"&gt;
                          &lt;xs:enumeration value=""/&gt;
                          &lt;/xs:restriction&gt;
                          &lt;/xs:simpleType&gt;
                          &lt;/xs:union&gt;
                      &lt;/xs:simpleType&gt;
                  &lt;/xs:element&gt;
  </code></pre>
  
  <p>None of them worked.</p>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Error detected : The 'xxxxxxxxxx:End_Date' element is invalid - The
    value '' is invalid according to its datatype
    'http://www.w3.org/2001/XMLSchema:date' - The string '' is not a valid
    XsdDateTime value.</p>
  </blockquote>