title: Can JAXB/MOXy map element value and element attribute to same POJO field?
body: <p>I've just started working on web services using JAXB to unmarshall the incoming SOAP documents to our domain classes. I've run into a technical challenge, which is dictated by the OIO XML format used within danish govermental institutions. The format states among other things, that it is not allowed to use the xml schema attribute nillable for an xml element declation. I thus have to find another solution to my challenge. </p>
  
  <p>Description
  We have a few numbers and dates which could be send by a webservice client to update the application. Those numbers and dates are mapped to POJO fields of equivalent types. The challenge is how to reset the value of such a POJO field, by constructing and sending correct XML. </p>
  
  <p>Sending 12:31:34T01-01-2010..... will update the POJO field to the specified value. </p>
  
  <p>I can however not reset the field by sending  as it's not allowed for datetime elements. </p>
  
  <p>I can also not send  as it is not allowed by OIO XML standard.</p>
  
  <p>I therefore as a grim workaround plan to send  as it should not be disallowed by the OIO XML standard. </p>
  
  <p>This how leads a challenge, that 
  if a startTime element contains a delete="true" attribute, then should the corresponding POJO field be set to null;
  if a  does not have a delete attribute, then transfer the valid element value to the POJO field. </p>
  
  <p>The @XMLElement annotation only allows me to map the startTime value, e.g.</p>
  
  <pre><code>class MyClass{
     @XMLElement
     private Date startTime;
  }
  </code></pre>
  
  <p>How can I force the delete attribute to also affect the value of the MyClass.startTime field?</p>
  
  <p>Best regards,
  Jesper</p>