How do I modify a XML Node?



I want to modify the Node my XML File look like this.



<Tasks>
<Task>
<Title>Title of the Task</Title>
<Description>Description of the Task</Description>
<Done>false</Done>
</Task>

<Task>
<Title>Title of anotherTask</Title>
<Description>Description of anotherTask</Description>
<Done>true</Done>
</Task>
</Tasks>


I could adress the Node like this:



xmlDoc.SelectSingleNode("/Tasks/Task/Description").InnerText = "My Description";


However I have mulitple Tasks. How do I indicate which is which? I want to change the State of the Task "Done" from false to true.


No comments:

Post a Comment