How can i remove preprocessing instructions from an XML in a greener way? suppose that I have this xml in a string variable (which is a property of a class),I wante
string
Try the code below. It will load the text to XmlDocument object first
XmlDocument
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlAsText);
Then you can get the OutherXml using below:
OutherXml
xmlDoc.DocumentElement.OuterXml;