title: JAXB, unmarshalling from XML, missing fields as null
body: <p>XML inputs are unmarshalled with <strong>moxy</strong> using namespaces with <strong>@XmlPath</strong>. It works fine. However, if a field from the xml is missing, then it is assigned an empty string after unmarshalling is done. I would like however null to be assigned in such cases. I put two simplified XML examples down below. I would like the element b to be assigned an empty string in the first example while a null value in the second example.
  Do you have any ideas? Thank you also in advance.</p>
  
  <pre><code>e.g. 1.
  &lt;ft:root&gt;
      &lt;ft:a&gt;hhh&lt;/ft:a&gt;
      &lt;ft:b&gt;&lt;/ft:b&gt;
  &lt;/ft:root&gt;
  
  
  e.g. 2.
  &lt;ft:root&gt;
      &lt;ft:a&gt;hhh&lt;/ft:a&gt;
  &lt;/ft:root&gt;
  </code></pre>