Proccess mapping only for each type once in a tree document