adds `id` attribute to expanded MUGL subtrees