XML string - select only certain nodes

crisss

New Member
I tried looking this up on here but couldnt find a proper answer. I have a XML string which has a bunch of nodes.
I want to extract only a couple of nodes from this string and append it with a new root element and return it.I know how to do this by loading this onto an XMLDocument and selecting nodes. Is there a better way of doing this using an XpathNavigator or XmlReader?This is my String\[code\]<root> <node1/> <node2/> <node3/> <node4/> <node5></root>\[/code\]I want my output string to be\[code\]<root> <node3/> <node4/> </root>\[/code\]Has to be done in an efficient manner.
 
Back
Top