tags:

views:

123

answers:

2

I need to simple xml parser like below.

xmlNode root=xmlDoc.DocumentElement;
root.appendChild(xmlElement.Parse("<book name='ff'>sample </book>");

is there any parser library or extension method like this .Parse("<book name='ff'>sample </book>")

+1  A: 

Consider using the newer Linq-to-Xml system in System.Xml.Linq. There is an XElement.Parse(string xml) function.

Jimmy
+3  A: 

If you're using .Net 3.5, you can use the XElement class to do exactly this. Check out the documentation for XElement.Parse().

womp
how to convert from XElement to xmlElement
ebattulga