Oracle Transactional Business Intelligence

How to include the XML Record without a subgroup data when filter on Subgroup is placed?
Summary
I want to include the All the Records without subgroup and with subgroup having some filter on it.
Content
Below is the sample XML Data:
<G_1>
<ID>008611</ID>
<PAYROLL_RELATIONSHIP_ID>123456789</PAYROLL_RELATIONSHIP_ID>
</G_1>
<G_1>
<ID>010671</ID>
<PAYROLL_RELATIONSHIP_ID>987654321</PAYROLL_RELATIONSHIP_ID>
<G_2>
<PAYROLL_RELATIONSHIP_ID>987654321</PAYROLL_RELATIONSHIP_ID>
<GROSS_WAGES>12345</GROSS_WAGES>
<NET_PAY>12345</NET_PAY>
</G_2>
</G_1>
<G_1>
<ID>010671</ID>
<PAYROLL_RELATIONSHIP_ID>1122334455</PAYROLL_RELATIONSHIP_ID>
<G_2>
<PAYROLL_RELATIONSHIP_ID>1122334455</PAYROLL_RELATIONSHIP_ID>
<GROSS_WAGES>0</GROSS_WAGES>
<NET_PAY>0</NET_PAY>
</G_2>
</G_1>
------------------------------------------------------------------------------------------------------------------------------------
If you see the above sample XML I want to print the records having Net or Gross Pay ZERO, or no records in G_2. So from the above sample middle record should get excluded. Can someone please help me achieve this in RTF Template.
Thanks!!