Preheat the oven to 200C/400F/Gas 6.
Place the roughly chopped apples with two tablespoons of water into a lidded pan and cover. Place over a medium heat and bring to a simmer. Cook for a 3-4 minutes until the apples have become light and softened.
Whisk the apples to a smooth purée, then set aside to cool.
Meanwhile, roll the pastry to a circle about 30cm/12in in diameter. Lightly score an inner circle 1cm/½in inside the edge of the pastry.
Brush the pastry with the beaten egg. Wait one minute, then brush the pastry again with more egg.
When the apple purée is cold, spread it over the inner circle of pastry.
Layer the thin slices of apple over the apple purée.
Brush the apple slices with the melted butter and sprinkle over the caster sugar.
Transfer to the oven to bake for 25-30 minutes, until the pastry is golden-brown and the apples are caramelised.
To serve, cut out slices and place into the centre of plates with a ball of ice cream placed alongside. Dust with icing sugar and serve.