At the end the goal is to creat a new XML file filtered from a whole list of NODES by comparison each noed attribute value with existing values list. my problem is: I can read the value of a particular node and then compare it with a dynamic variable value, But after that I want to read the tag that's wrapping it and copy it to my new XML file.
<Rule Id="2" On="a1" PL="3305" ActionResult="enabled">
<Members Operation=""><Member QId="a2" Operation="In" Attribute="checked">true
</Member></Members></Rule></Rules>
and my code to get the values to compare is:
var ElementsList = from Elements in xdoc.Descendants("Members")
where Elements.Element("Member").FirstAttribute.Value == "rbtn_G9000_1_11_1201__2"
select Elements.Element("Member");
this will give me the code for the node itself, i need the code to get the wrapping node (Rule)...
how can i do this?