How do I return correct event elements

How do I return correct event elements

How do I return correct event elements

I have a xml 1.0 document with 3 JudgmentEvent.
What I would like to get as output is
1. JudgmentEvent whose parent have not been deleted.
2. JudgmentEvent that have no parent and they have not been deleted.