I have a question I have a simple xml:
<Event>
<Value>Some Text</Value>
<Value>
<Solution Flag="1" />
</Value>
</Event>
Value allays contains one child text or different node.
And simple process:
const string xml = @"<Event><Value>Some Text</Value><Value><Solution Flag = ""1""/></Value></Event>";
XDocument xDocument = XDocument.Parse(xml);
IEnumerable<XElement> xPath = xDocument.XPathSelectElements($"//Event");
foreach (XElement xElement in xPath)
{
// check if xElement child is a string or x element
}
Now what I am trying to do is iterate each xElement in event and check if node (Value) is text or different x element, but I do knot know exactly hot to do that. Any ideas?