Assign XProfile Field Groups to Members

I'm trying to assign xprofile field groups to members based on their membership type / capeabilities.

I have a field in the registration form where they select a profile type. I'd like to use this other than using a member role.

I'm finding it difficult to work out how to pass the argument in the edit loops for example, or is there a better method??