I have a xml document that I would like to return (output) only non-deleted judgment information, the base judgment information when all of the amendments to it have been deleted and only a single instance of each judgment.
How do I do this?
Here is my xml 1.0 document
<?xml version="1.0" encoding="UTF-8"?>
<Pipeline>
<SourceXML>
<Integration>
<Case>
<JudgmentEvent InternalID="1734529845" ID="175057896" Date="05/05/2016">
<JudgmentEventType InternalID="13024" Word="JUDGGR">Judgment</JudgmentEventType>
<Deleted>true</Deleted>
<Judgment ID="3532520" InternalID="1612847489"/>
<JudgmentEvent InternalID="1734529843" ID="175057895" Date="05/05/2016">
<Deleted>false</Deleted>
<Judgment ID="3532519" InternalID="1612847488"/>
</JudgmentEvent>
</JudgmentEvent>
<JudgmentEvent InternalID="1734529863" ID="175057907" Date="05/05/2016">
<Deleted>true</Deleted>
<Judgment ID="3532521" InternalID="1612847490"/>
<JudgmentEvent InternalID="1734529843" ID="175057895" Date="05/05/2016">
<Deleted>false</Deleted>
<Judgment ID="3532519" InternalID="1612847488"/>
</JudgmentEvent>
</JudgmentEvent>
</Case>
</Integration>
</SourceXML>
</Pipeline>
Correct output should look like this
<CourtDecisions>
<FamilyJudgment judgmentKey="3532520">
<JudgmentEventTypeText>Judgment</JudgmentEventTypeText>
<JudgmentEventDate>2016-05-05</JudgmentEventDate>
<AmendedJudgment>
<AmendedReasonText>Court Order</AmendedReasonText>
<AmendedDate>2016-05-05</AmendedDate>
<JudgmentReference judgmentKey="3532519"/>
</AmendedJudgment>
</FamilyJudgment>
</CourtDecisions>