How do you create a standalone XML node in .NET?
I have an XMLElement type that I’m trying to set a value to, but since the constructor for that class is protected, it won’t let me do it.
This is what I’m currently doing:
XmlDocument xmldoc = new XmlDocument();
XmlElement foo = xmldoc.CreateElement("", "foo"); ;
XmlElement bar = xmldoc.CreateElement("", "bar"); ;
Is there a better way to do this?
you can try this