I am going to assume that the products are fairly simply defined. I am also going to assume that you know how to use the BuildRowSetFromXML function as you stated you already have a loop that writes all products ordered.
It honestly just sounds like you need a conditional in there around the output section to validate the product.
FOR @i=1 TO Rowcount(@myRowSet) DO
set @row = (@myRowSet,@i)
set @val = Field(@row,1)
if IndexOf(@val,'clothing') > 0 then
OUTPUT(CONCAT("Clothing item: ", @val))
Which will only run the output if the value of
val contains the word
clothing in it. Now be aware there can be false positives if two words combine to make your word. for instance if you had a product named
ClakcloThing, that would match with the indexOf() above and say it is to be output. So if you keep those exceptions in mind, this should handle your needs.
Now this can be process heavy if you are looking at a ton of loops or a ton of iterations, but in that case, you will likely want to utilize SQL or some other server-side data manipulation before-hand to better prep your data.