To make filling:
Break open coconut and scoop out flesh, then grate.
Bring 500ml water to the boil, along with coconut, vanilla pod (broken open and crushed), grated lime zest, a pinch of cinnamon and nutmeg.
Stir well.
Leave to cook for about 30 minutes, stirring regularly.
Remove from heat and leave to cool.
Roll out pastry and line a greased flan dish.
Mix cooled coconut filling and custard together, then pour into pastry case.

Beat the eggs with sugar and flour.
Add this mixture to the flan, to 1.5cm from the top of the pastry case.
Cook in an oven preheated to 325°F (160°C), for 45 minutes.
Sprinkle with cocoa powder and serve.