def METHOD_NAME(root, subkey):
    try:
        hkey = OpenKey(root, subkey, access=KEY_ALL_ACCESS)
    except OSError:
        # subkey does not exist
        return
    while True:
        try:
            subsubkey = EnumKey(hkey, 0)
        except OSError:
            # no more subkeys
            break
        METHOD_NAME(hkey, subsubkey)
    CloseKey(hkey)
    DeleteKey(root, subkey)