ESQL
SET OutputRoot = InputRoot;
DECLARE X INT;
SET X = CARDINALITY(Root.Parent.Child[]);
WHILE X >= 1 DO
SET OutputRoot.XML.Parent.Child[X] = NULL;
SET X = X - 1;
END WHILE;
Here's a slighlty different angle. (A variation of martinrydman's answer.)
You are copying the whole tree and then deleting a whole bunch of it. You might want to consider just copying the message headers and then assigning just the couple of values you need to the output tree.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum