title: XmlAdapter not working as expected in JAXB RI
body: <p>I am trying to implement a XmlAdapter for modifying the marshalling/unmarshalling of certain object properties. Particularly, I tried with the <code>NullStringAdapter</code> described here:</p>
  
  <p><a href="https://stackoverflow.com/questions/5989922/jaxb-xsattribute-null-values">Jaxb: xs:attribute null values</a></p>
  
  <p>The objective of the <code>NullStringAdapter</code> is marshalling null values as empty strings, and viceversa.</p>
  
  <p>The only difference with the example described above and my code, is that I want to apply the adapter to an element, not to an attribute, so what I have is:</p>
  
  <pre><code>@XmlElement
  @XmlJavaTypeAdapter(NullStringAdapter.class)
  public String getSomeValue() {
      return someValue;  //someValue could be null, in that case the adapter should marshall it as an empty string
  }
  </code></pre>
  
  <p>However, after some debugging, I realized that the Adapter methods are never called during the marshalling from Java to XML!. This occurs when the XmlElement value is null. 
  When this value is different than null, the adapter methods are called as expected.</p>
  
  <p>Thanks for any help!.</p>