title: xml serialization and comments
body: <p>I'm working on some custom xml editor. I have a library that contains all the classes that can be de/serialized. The problem is that during deserialization all the comments that were in the xml are lost. Let's say I have a xml structure:</p>
  
  <pre><code>&lt;mainNode&gt;
      &lt;subNode name="firstSubNode"&gt;
          &lt;item prop1="a" prop2="b"/&gt;
          &lt;item prop1="c" prop2="e"/&gt;
          &lt;!--Here I have important comment--&gt;
          &lt;item prop1="d" prop2="f"/&gt;
      &lt;/subNode&gt;
      &lt;!--and also here I have a comment--&gt;
      &lt;subNode name="secondSubNode"&gt;
          &lt;item prop1="a" prop2="b"/&gt;
          &lt;item prop1="c" prop2="e"/&gt;
      &lt;/subNode&gt;
  &lt;/mainNode&gt;
  </code></pre>
  
  <p>Now when I deserialize such xml file I will have a main object (mainNode) that contains two subNodes with items. Now if I serialize this object, the result will be the same file but without comments.</p>
  
  <p>The question: is there a way to keep this comments when running serialize/deserialize method? If yes how will this work when I add/remove/edit some nodes/items that contain comments.</p>