I have the following XML structure:
<root>
<Level1 IsEnabled="0"> <!-- Disabled -->
<Level2 IsEnabled="1">
<Level3 IsEnabled="1">
<Level4 IsEnabled="1">
<Child /> <!-- Don't include this one -->
</Level4>
</Level3>
</Level2>
</Level1>
<Level1 IsEnabled="1">
<Level2 IsEnabled="1">
<Level3 IsEnabled="0"> <!-- Disabled -->
<Level4 IsEnabled="1">
<Child /> <!-- Don't include this one -->
</Level4>
</Level3>
</Level2>
</Level1>
<Level1 IsEnabled="1">
<Level2 IsEnabled="1">
<Level3 IsEnabled="1">
<Level4 IsEnabled="1">
<Child /><!-- Include this one -->
</Level4>
</Level3>
</Level2>
</Level1>
</root>
I want to select all child nodes where any of its ancestors do not contain IsEnabled="0". So for the XML above I only want to select the last child node. In addition, if a ancestor node doesn't contain a IsEnabled attribute, then the child should still be included.