Sift the flour and icing sugar into a bowl. Rub in the butter with your fingertips, or use a processor, until the mixture resembles fine breadcrumbs.
Stir in the egg yolks and water to make a soft dough. Wrap in plastic wrap and chill in the fridge for 30 minutes.
Roll out the pastry on a lightly floured work surface until it's large enough to line a lightly greased 28 cm flat tin.
Cream together the butter and sugar until light and fluffy, then gradually beat in the eggs. If the mixture starts to separate, stir in a little of the cocoa.
Stir in the cream with the remaining cocoa powder and vanilla essence.
Pour filling into prepared pastry shell.
Place flan tin on a baking tray and bake in preheated 180 °C oven for 45 minutes. Remove from oven and leave to cool.
Spread the melted chocolate on the back of a clean baking sheet and leave to set. Hold a long sharp knife at a 45° angle, and pull it along the chocolate to shave off thin scrolls.
Keep them in the fridge until ready to use. (Alternatively you could grate the chocolate.)
Pile the cream onto the filling and decorate with chocolate curls.