Preview:
String input = 'Envelope,Body,describeSObjectResponse,result, custom,customSetting, childRelationships,relationshipName,childSObject';

String[] values = input.split(',');
for(integer i=0, max=values.size(); i<max; i++){
	values[i] = values[i].trim();
}


System.debug('Set<String> xmlTagFilter = new Set<String>{\''  + String.join(values,'\', \'') + '\'};');
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter