I\'ve my object, configured with the code:
object.setName(\"\");
marshaled into following XML:
&
The answer to my question was found in another question How to instantiate an empty element with JAXB where it's suggested to either use a prettifier or don't do anything at all because both versions of XML are equivalent.