How do I remove the CDATA tag of an XElement?
问题 I have some code that receives some XML and there is the possibility that a CDATA tag element will be present. A flag is passed into the method that states whether the CDATA tag should be present, if the flag is false, then the CDATA tag should be removed if present, how would I do this without parsing the query.Value? private static void CDataTagUtility(XmlDocument catalog, XElement newData, bool addCdataTag) { XElement query = newData.Element("Query").Element("CommandText"); if (addCdataTag