Preheat the oven and a baking sheet to 180C/356/Gas 4.
Divide the pastry into two halves, one slightly bigger than the other. Roll out the bigger piece and line a shallow, greased dish, leaving some overhang. Sprinkle some sugar over the surface, then throw in the gooseberries.
Sprinkle over the potato flour, the rest of the sugar and the elderflower cordial, then dot with the butter.
Roll out the remaining piece of pastry for the lid, place it over the top, then seal with a fork all round the edges.
Cut a cross in the middle through which the steam can escape, brush with beaten egg, then scatter a bit of demerara sugar over the surface.
Place on the hot baking sheet and cook for about 25 minutes. Turn the heat down a bit and continue to cook for another 20-25 minutes until golden and bubbling.
Cool for at least 15 minutes, then serve with clotted Jersey cream, or homemade custard.