I have a variable XML that might look something like this:
<content>
<main editable="true">
<h1>Here is my header</h1>
<p>Here is my content</p>
</main>
<buttons>
<positive editable="true">I agree!</positive>
<negative editable="true">No - get me outta here!</negative>
</button>
</content>
I'd like to get the XPath for all of the nodes that have the attribute "editable" that equals "true". Please note that the attributes can be at variable node levels so I can't just loop through all the nodes at one level and check for the attribute. I'd also like to use XmlReader because of the speed but if there's a better/faster way, then I'm open to that as well.
var xml = IO.File.ReadAllText(contentFilePath);
var readXML = XmlReader.Create(new StringReader(xml));
readXML.ReadToFollowing("content");
while (readXML.Read()) {
//???
}