startTagBuffer.setUnderlyingReceiver(useWhenFilter);
StylesheetStripper styleStripper = new StylesheetStripper();
styleStripper.setUnderlyingReceiver(nsReducer);
CommentStripper commentStripper = new CommentStripper();
commentStripper.setUnderlyingReceiver(styleStripper);
commentStripper.setPipelineConfiguration(pipe);
// build the stylesheet document
commentStripper.open();
rawDoc.copy(commentStripper, CopyOptions.ALL_NAMESPACES);
commentStripper.close();
DocumentImpl doc = (DocumentImpl)styleBuilder.getCurrentRoot();
styleBuilder.reset();
return doc;