Add the flour, sugar, salt, and xanthan gum to the bowl of a food processor. Blitz to combine.
Add cubed butter, and blitz again until the mixture resembles breadcrumbs.
Transfer the mixture to the bowl of an electric mixer with a dough hook attachment. Add the flax egg, and mix on low speed while gradually adding cold water just until it forms a dough consistency.
Shape the dough into a ball, cover it in plastic wrap, and chill for 30 minutes in the refrigerator.
Preheat the oven to 350 degrees F (180 degrees C).
Roll the dough between 2 sheets of parchment paper until it is a few inches larger than your pie plate.
Lay the dough over the pie plate, and gently push it into all cracks and edges of the plate. Use a knife to cut away the excess dough. Prick the dough with a fork a few times, and chill in the refrigerator for another 30 minutes.
Place parchment paper over the pie plate, and fill with pie weights, dried beans, or dried rice. Bake for 20 minutes. Remove paper and pie weights, and bake for another 10 to 15 minutes.
Fill pie crust as desired.