oops I think I misled you, you don't want the current node to come from the function call, but to be the loop variable, so use {$user-group/@id} etc rather than just ({@id} David