Preheat the oven to 175C/325F/gas 3.
Grease the tart tin with butter.
To make the pastry sift the flour and salt into the mixing bowl or food processor bowl.
Add the butter and rub in (or process if using food processor) until the mixture resembles fine breadcrumbs.
Break the egg into a cup and add the ice cold water and whisk together.
Add to the pastry mix and bring together to make a dough adding more water if the dough is too dry. If using a processor add the egg mixture and whizz until the mixture forms a ball of dough.
Wrap the dough in clingfilm and place in the fridge for 30 minutes.
Roll out the pastry on a lightly floured work surface and line the tart tin with it.
Scrunch up a large piece of baking paper, open it out and place over the pastry. Fill with baking beans and bake in the preheated oven for 15 minutes.
Take out of the oven, remove the paper and baking beans and brush the pastry with the beaten egg. Return to the oven for a further 10 minutes. Remove from the oven and set aside to cool.
Cut the medlars and twist in half widthways, as you might do with an avocado (except there are 5 pips rather than one large one).
Scoop or squeeze the soft flesh into a bowl, removing pips as you go.
Add the remaining filling ingredients and beat together with the electric hand whisk.
Fill the pastry case with the medlar mixture and smooth the surface with a palette knife.
Place in the preheated oven and bake for 20 to 30 minutes.
Remove from the oven and allow to cool to room temperature.
Once cooled mix the icing sugar and water until you have a fairly stiff paste. Place in the piping back and decorate the top of the tart as you will.