Using JAXB (2) is it possible to ensure that null values are not marshalled as () empty elements. For instance
@XmlRootElement(name = "root")
public class Root {
@XmlElement(name = "name")
protected String name;
}
Currently if name is null then I am marshalling
<root>
<name/>
</root>
I would like to produce
<root>
</root>
instead.