Fix error U4-3876

MySQL has limitations on using subselects to determine records to delete.  This was causing problems when clearing the XML cache.  This fix restructures the query to fix U4-3876.

This fix has been tested on MySQL.  I don't have a MSSQL instance to test it, but I don't think it should break things there.