Loop over a Tree

Dear All,
I have a tree which contains K*N branches Like N_Var_K and I would like to fill a new Tree which would contains K branches like Var_K.
So to fill out for each K the N branches N_Var_K in a Branch Var_K.

Do you have a easy way to handle that problem ?