In .NET, how do I read the text content from an XElement?
For example, from the XElement
XElement.Parse("<tag>Alice & Bob<other>cat</other></tag>")
I would like the string 'Alice & Bob'
I tried element.Value
but that returns 'Alice & Bobcat' :(
XElement t = XElement.Parse("<tag>Alice & Bob<other>cat</other></tag>");
string s = (t.FirstNode as XText).Value;