I think what I'd do is make the entire list one variable in the main template, then create another small template to display one membership line. Then construct that list variable in the loop so it will be ready to use when you call "fetch_template" for the main template at the end.