Hi I need to create an XElement from a string, which can be xml or plain string.
This code
var doc = new XDocument(
new XElement("results", "<result>...</result>")
);
produces this
<results><result></result></results>
But if the string is XML, then I need proper XMl
<results><result>...</result></results>
Any ideas other than XElement.Parse() because it will throw exception if it is plain text?