MPS-19673 Template fragment cannot be created inside ELSE branch of IF macro. Besides, do not allow node macros under TF.
Reuse node tree iterator code everywhere we walk nodes