Build a tree with multiple versions and scopes by one model class.