Given the following xml input:
<Sections>
<Section number="1">
<Step number="1">
<SubStep number="1" Pass="True">
<SubSubStep number="1" Pass="True"/>
<SubSubStep number="2" Pass="True"/>
</SubStep>
</Step>
<Step number="2">
<SubStep number="1" Pass="False">
<SubSubStep number="1" Pass="True"/>
<SubSubStep number="2" Pass="False"/>
</SubStep>
</Step>
</Section>
</Sections>
How can I transform it to:
<Sections Pass="False">
<Section number="1" Pass="False">
<Step number="1" Pass="True">
<SubStep number="1" Pass="True">
<SubSubStep number="1" Pass="True"/>
<SubSubStep number="2" Pass="True"/>
</SubStep>
</Step>
<Step number="2" Pass="False">
<SubStep number="1" Pass="False">
<SubSubStep number="1" Pass="True"/>
<SubSubStep number="2" Pass="False"/>
</SubStep>
</Step>
</Section>
</Sections>
I want to infer the result of the parent from the children. If any of the children have a Pass="False" result the parent result will be Pass="False". Backwards recursion?