I have a XML in the following format:
<break name="Chapter01">
<!--Chapter 1-->
<p class="para">Some value</p>
</break>
<break name="Chapter02">
<!--Chapter 2-->
<p class="para">Some value</p>
</break>
<break name="Chapter03">
<p class="para">Some value</p>
</break>
When I am loading the file using XDocument.Load(fileName)
, all the comments are gone.
It is becoming:
<break name="Chapter01">
<p class="para">Some value</p>
</break>
<break name="Chapter02">
<p class="para">Some value</p>
</break>
<break name="Chapter03">
<p class="para">Some value</p>
</break>
How do I preserve the comments when reading the file using XDocument.Load()
?