Read an XML file, look to see that there are "transactions" at a certain XPath. Look at specific attributes to determine if the transactions should be kept or removed. If all transactions are removed, insert a placeholder transaction.

Example XML, in this case I would be writing out the same XML without Transaction elements 1,2,4,5:

<ROOT>

<STUFF>

<Transaction ItemNum="1" Valid="Yes" Keep="No"/>

<Transaction ItemNum="2" Valid="Yes" Keep="No"/>

<Transaction ItemNum="3" Valid="Yes" Keep="Yes"/>

<Transaction ItemNum="4" Valid="Yes" Keep="No"/>

<Transaction ItemNum="5" Valid="Yes" Keep="No"/>

</STUFF>

</ROOT>

Example XML, in this case I would be writing out the same XML without Transaction elements 1,2,3,4,5 and inserting a new element that looks like <Transaction ItemNum="0">