I’m curious, what would be the neatest way to parse a string of xml nodes to a XmlNodeList. For example;
string xmlnodestr = "<mynode value1='1' value2='123'>abc</mynode>
<mynode value1='1' value2='123'>abc</mynode>
<mynode value1='1' value2='123'>abc</mynode>";
I could possibly do a string split on the list, but that would be messy and non-proper.
Ideally I want something like;
XmlNodeList xmlnodelist = xmlnodestr.ParseToXmlNodeList();
You could add a root to your XML then use this approach:
If you can use LINQ to XML this would be much simpler, but you wouldn’t be working with an
XmlNodeList: