How do i remove Certain tags from the XML based on a Lookup ??

To give more insight into the problem,

I have a complex XML, the data of which i have already loaded in a DB table. (This table contain all the data..with no filters applied.)

Now i have to do a lookup on this table (The query here has a filter applied), based on the matching ID's ..i need to fetch the whole tag from the XML and dump it in a new XML.

If it was only that tag..i would have used the Add XML component and XML output to generate it. But the tag has many sub tags ..hence the reason that i just want to push the matching ID's tags into a new XML.

PDI 4.4 CE