Heat the oven to 190°C/gas mark 5.
Unroll the pastry sheets, keeping them both on their baking parchment.
Spread the pesto over 1 of the pastry sheets, then scatter over half of the grated cheese.
Flip the second sheet of pastry on top, pressing down to stick the 2 sheets of pastry together.
Remove the top layer of baking parchment.
Cut out a Christmas tree shape, a large triangle with a small stump at the bottom, using as much of the pastry as possible.
Cut a star shape out of the offcuts for the top of the tree, reserving the rest of the offcuts.
Transfer the tree to a large baking tray, brush over the beaten egg, then repeat with the star to stick it to the tip.
Scatter over the remaining cheese, then gently press to help it stick to the pastry.
Cut vertical lines into the sides of the tree, about 1cm apart, leaving a trunk of about 2cm up the middle.
Twist the strips of pastry, then stick them back down onto the tray, repeating with all the branches.
Cut the offcuts into straws, then arrange them on a second baking tray.
Bake for 25 minutes, then remove from the oven and leave to cool slightly. Can be eaten warm or cold.
