Preheat your oven to 400 degrees Fahrenheit. Line a large baking sheet with parchment paper so the pastry does not stick. Ensure your puff pastry is thawed according to the package instructions but keep it cold until you are ready to work with it to maintain those flaky layers.
Lay one sheet of puff pastry flat on the prepared baking sheet. Spread the basil pesto evenly across the surface, leaving a small border around the edges. Sprinkle the grated parmesan cheese over the pesto layer. Place the second sheet of puff pastry directly on top of the first, aligning the edges as closely as possible.
Using a sharp knife or a pizza cutter, cut the pastry into the shape of a large triangle with a small rectangular trunk at the bottom. Do not discard the scrap pieces of pastry, you can bake those separately as small snacks. You should now have a triangle that resembles the silhouette of a pine tree.
Cut horizontal slits along both sides of the triangle, about one inch apart, leaving a solid center column intact to act as the tree trunk. Each slit creates a branch. Take each branch and gently twist it twice, moving from the bottom of the tree up to the top. This gives the tree its beautiful textured look.
In a small bowl, whisk the egg and water together to create an egg wash. Brush the entire surface of the pastry tree with the egg wash to ensure a golden brown finish. Sprinkle with red pepper flakes if desired. Bake for 18 to 20 minutes, or until the pastry is puffed and deeply golden. Once out of the oven, garnish with fresh parsley and halved cherry tomatoes to look like ornaments.