put your OUTPUT clause
right after you INSERT INTO
statement something lie this....
INSERT INTO TableName (Column1, Column2, Column3.....)
OUTPUT inserted.Column1 , inserted.Column2 INTO @TableName
SELECT Column1, Column2, Column3.....
FROM Table_name
On a side note I would suggest you to keep XML Shredding
and your INSERT
operations in separate statements. any hanky panky in your XML can leave you with a lot of cleaning to do :)
do the shredding separately insert results into a temp table, once happy then insert into your target tables.