To a large mixing bowl add plain gluten free flour, xanthan gum, sugar and salt. Mix well.
Add your cold cubed butter and rub in with a fork until it starts to look like breadcrumbs.
Add your egg and mix in using a table knife.
Add water 1tbsp at a time and mix well until it starts to form a dough (you will need around 3-4 tbsp water).
Turn out onto a floured surface and knead until smooth. Wrap in clingfilm and leave in the fridge for atleast an hour.
After an hour preheat your oven to 180°C and remove the pastry from the fridge. Roll out on a floured surface until it's about 1cm thick.
Cut out 12 circles (larger than your cupcake tin) and press the circles into your cupcake tin, ensuring that you press the pastry up the side of the tin.
Add baking paper and baking beans to each of the pastry cups. Blind bake for 10 minutes. Remove the baking paper and beans and bake for an additional 10 minutes. Remove from the oven and leave to cool whilst you make your frangipane mix.