How to save an XmlDocument object when you don't know path where it is getting stored?

93 Views Asked by At

I have one XPathDocument object. Which I convert to XmlDocument object using:

XmlDocument xmldoc = new XmlDocument();    
xmldoc.Load(doc.CreateNavigator().ReadSubtree());

Now I have updated this xmldoc object and trying to save using Save method. But it expects a string which I don't know.

How should I save my changes to this? Please suggest. Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

Try this:

 XPathDocument result = new XPathDocument((doc.CreateNavigator().ReadSubtree()));