Easy to do with Everything
https://www.voidtools.com/ For example if the start folder of the tree is "C:\tree" then you can list all its subfolders with "xyz" in the subfolder name with this search line. (The option "match path" in the menu "Search" must also be enabled.)
"C:\tree\" xyz folder:
You can then select the subfolders in the results list and delete them, just like in File Explorer. Doing so will also delete any files within those subfolders, of course. If the subfolder name fragment you search for has spaces then quote enclose it e.g. "abc def".

This basic example can be modified for more complex searches, for example with regex pattern matching instead of a plain string.