title: How to generate xml single empty tag for null values while generating xml in JAXB
body: <p>I am trying to generate xml using JAXB While converting object to xml for null values its coming double empty tag like:</p>
  
  <pre><code>&lt;tag&gt;&lt;/tag&gt;
  </code></pre>
  
  <p>But i want this output: </p>
  
  <pre><code>&lt;/tag&gt;
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>@XmlElement(nillable = true)
  private String VoyageID;
  </code></pre>
  
  <p>But output is coming like this:</p>
  
  <pre><code>&lt;VoyageID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;
  </code></pre>
  
  <p>I dont want null policy description.
  Just want this output: </p>
  
  <p>But i tried to remove extra information xmlns:xsi but i am not able to make it work. I tried using package-info.java also but that namespace url coming in above root element of xml.</p>
  
  <pre><code>&lt;VesselDetails&gt;
              &lt;OceanCarrier Code=""&gt;
                  &lt;Vesselname&gt;&lt;/Vesselname&gt;
                  &lt;VoyageId&gt;&lt;/VesselVoyageId&gt;
                  &lt;PortofEntry&gt;&lt;/PortofEntry&gt;
              &lt;/OceanCarrierSCAC&gt;
  &lt;VesselDetails/&gt;
  </code></pre>
  
  <p>I want output like below:</p>
  
  <pre><code>&lt;VesselDetails&gt;
  &lt;OceanCarrier Code=" "&gt;
  &lt;Vesselname/&gt;
  &lt;VoyageId/&gt;
  &lt;PortofEntry/&gt;
  &lt;/OceanCarrierSCAC&gt;
  &lt;/VesselDetails&gt;
  
  </code></pre>