code: public void configureForRoundTripping()
      {
          // StAX (1.0)
          doCoalesceText(false);
          doReplaceEntityRefs(false);
          
          // StAX2:
          doReportCData(true);
          doReportPrologWhitespace(true);
          
          // Woodstox specific settings
          doTreatCharRefsAsEnts(true);
          doNormalizeLFs(false);
  
          // effectively prevents from reporting partial segments:
          setShortestReportedTextSegment(Integer.MAX_VALUE);
      }
docs: Method to call to make Reader try to preserve as much of input
  formatting as possible, so that round-tripping would be as lossless
  as possible.
  <p>
  See {@link XMLInputFactory2#configureForLowMemUsage} for
  required settings for standard StAX/StAX properties.
  <p>
  In addition to the standard settings, following Woodstox-specific
  settings are also done:
  <ul>
  <li>Increases <code>P_MIN_TEXT_SEGMENT</code> to the maximum value so
  that all original text segment chunks are reported without
  segmentation (but without coalescing with adjacent CDATA segments)
  <li>
  <li>Sets <code>P_TREAT_CHAR_REFS_AS_ENTS</code> to true, so the all the
  original character references are reported with their position,
  original text, and the replacement text.
  </li>
  </ul>