Rename node name
Is it possible to rename a node name which has elements in it?
I have this xml file:
<?xml version="1.0" encoding="UTF-8"?>
<Content>
<Element1>ele2</Element1>
<Element2>ele2</Element2>
</Content>
I want to replace Content with Page in my C# application and I tried:
XmlNode firstNode = xmlDoc.SelectSingleNode("Content");
firstNode.LocalName.Replace("Content","Page");
its not giving any error but it is not updating the file also. Is there anyway to rename this node name?
|