title: How do I prevent a pair of XMLEvent[Reader|Writer] from splitting empty tags into start+end tags?
body: <p>I have an understanding problem of how the following code works:</p>
  
  <pre><code>XMLInputFactory xif = XMLInputFactory.newFactory();
  XMLOutputFactory xof = XMLOutputFactory.newFactory();
  
  XMLEventReader reader = xif.createXMLEventReader(/* ... */);
  XMLEventWriter writer = xof.createXMLEventWriter(/* ... */);
  
  writer.add(reader);
  </code></pre>
  
  <p>The method writer.add([some reader]) reads all events from reader and writes them consequently. Sadly, following happens:  </p>
  
  <p>The input</p>
  
  <pre><code>&lt;root&gt;&lt;c/&gt;&lt;/root&gt;
  </code></pre>
  
  <p>gets transformed to</p>
  
  <pre><code>&lt;root&gt;&lt;c&gt;&lt;c/&gt;&lt;/root&gt;
  </code></pre>
  
  <p>I know, from XML point of view, these are equal trees, but not for a human ;)</p>
  
  <p>What can I do to get the same output?</p>
  
  <p><em>FYI: I need a XMLEvent[Reader|Writer] pair later to filter "XML events".</em></p>