I am trying to get the End node of an XElement in a C# Console application.
Say for example my XML Content is:
<Object>
<Item>Word</Item>
<Value>10</Value>
</Object>
How can I fetch </Object>
as a node?
On iterating through element.DescendantNodesAndSelf()
I still don't see isolated </Object>
node.
static void Main(string[] args)
{
const string xmlString = "<Object><Item>Word</Item><Value>10</Value></Object>";
var element = XElement.Parse(xmlString);
foreach (var node in element.DescendantNodesAndSelf())
{
Console.WriteLine($"{node}");
}
Console.ReadLine();
}