Preheat your oven to 400 degrees Fahrenheit and line a large baking sheet with parchment paper to prevent sticking. Ensure your puff pastry is thawed according to the package instructions but remains cold to the touch, as this ensures the fluffiest layers.
Unroll the first sheet of puff pastry directly onto the parchment paper. Spread the pesto evenly across the surface, leaving about a half-inch border around the edges. Sprinkle the mozzarella and parmesan cheese over the pesto layer.
Carefully place the second sheet of puff pastry directly over the first one, aligning the edges as closely as possible. Gently press down with your hands to seal the two layers together slightly.
Using a sharp knife or a pizza cutter, cut the pastry into a large triangle shape to form the body of the tree. From the remaining scraps, cut out a small star for the top of the tree and a small rectangle for the base or trunk.
Cut horizontal slits about one inch apart along both sides of the triangle, making sure to leave a center column about one inch wide untouched to serve as the trunk. These slits will become the branches of your tree.
Take each pastry strip and gently twist it twice, moving upwards toward the top of the tree. The twists at the bottom will be longer, while the ones near the top will be shorter. Place the star at the very top of the tree.
Brush the entire tree, including the star and trunk, with the beaten egg wash. Sprinkle the dried oregano and garlic powder over the top. Bake for 15 to 18 minutes, or until the pastry is puffed and a deep golden brown. Garnish with fresh rosemary once slightly cooled.