Heat the oven to 200°C (180° fan).
Grease a 6-8 tartlet tins.
For the pastry
Combine the flours, xanthan gum and salt in a mixing bowl.
Rub in the butter and until the mixture resembles breadcrumbs.
Add the egg and mix, then gradually add the water, mixing until the dough forms a ball.
Wrap in cling film and chill for 30 minutes.
Roll out the dough on a floured surface and cut out rounds to fit the tins.
Line the tins with the pastry and prick the bases with a fork.
Bake for 10 minutes. Remove from the oven and place on a wire rack to cool.
For the filling
Heat the oil in a frying pan and gently cook the shallots and celery for about 2 minutes.
Add the mushrooms, season with salt and pepper, and cook for 5 minutes until tender.
Add a little water if the pan is too dry.
Divide the filling amongst the tartlet cases and bake for 10 minutes until the pastry is cooked.
Sprinkle the fried onion over the tops and serve immediately.