I have a tree in form of XML that stores it in XELement variable.How I can search a value in All Nodes in this XML and if it exists return true?
XML
XELement
true
Try this:
bool result = element.DescendantsAndSelf().Any(e => e.Value == "cccc");