Preheat oven to 350°F and line a large baking sheet with parchment paper. Set aside.
In a large mixing bowl, combine spinach, artichoke hearts, garlic, cream cheese, sour cream, salt, and cayenne pepper. Add parmesan cheese and mozzarella cheese. Stir to combine. Set aside.
Place one sheet of puff pastry onto the lined baking sheet.
Spread the spinach mixture over the puff pastry in the shape of a large triangle (a tree).
Place the second sheet of puff pastry over the spinach dip.
Working gently with your fingers, feel the outline of where the spinach mixture is spread. Using a pizza cutter or a sharp knife, carefully begin cutting along the edges. Remove excess pastry.
Cut 1-inch slits on both sides of the tree, leaving about an inch in the center intact. This is the 'trunk' of the tree.
At the base of the tree, carefully cut away the bottom strip on both sides, forming the base of the tree trunk. The tree 'branches' are now ready for twisting.
Beginning at the base, twist the pastry away from you, trying to get in at least two turns on the lower branches. Continue moving up the tree, twisting away from you as you go. At the top of the tree, you may only get a single twist in the top branches.
Brush the top pastry with the beaten egg.
Bake for 26-28 minutes, or until golden brown.