my xml file is
<?xml version="1.0" encoding="UTF-8"?>
<journal-meta>
<issn>Modern data ' is needed with dummy content. we are good to go.</issn>
<issn1><![CDATA[ é ]]>Modern data is needed with dummy content. we are good to go.</issn1>
]]>Modern data is needed with dummy content. we are good to go.</issn1>
<issn2>éModern data is needed with dummy content. we are good to go.</issn2>
<issn3>'Modern data is needed with dummy content. we are good to go.</issn3>
<issn4>&Modern data is needed with dummy content. we are good to go.</issn4>
<issn5>–Modern data is needed with dummy content. we are good to go.</issn5>
</journal-meta>
using this code truncating file data
string inputString = File.ReadAllText(OFile);
File.WriteAllText(
"output.xml",
CdataText
);
<?xml version="1.0" encoding="UTF-8"?>
<journal-meta>
<issn>Modern data ' is needed with dummy content. we are good to go.</issn>
<issn1><![CDATA[ é ]]>Modern data is needed with dummy content. we are good to go.</issn1>
]]>Modern data is needed with dummy content. we are good to go.</issn1>
<issn2>éModern data is needed with dummy content. we are good to go.</issn2>
<issn5>–Modern data is needed with dummy content. we are good to go.</issn5>
</journal-meta>