For the dough: Mix all the ingredients to form the dough. Wrap it in plastic wrap and chill for 30 minutes. Roll it out to form a rectangle. The layers are created by folding the dough, so start by folding it into thirds by lifting one end over the middle third and folding the other side over the folded third. Rotate the dough 90 degrees (vertically) so that the folds are now facing left and right. Roll it out again to flatten it and repeat the folds. Wrap in plastic wrap and chill for 1 hour.
For the applesauce: Place butter, sugar, water and vanilla in a skillet over medium heat. Add the apples, put the lid on and cook over low heat until tender. Take the lid off, mash the apples and cook until thickened and all the liquid has evaporated. This may take a while. Let it cool.
Preheat oven at 180°C/350°F. Roll out the dough to form a rectangle and place it on a sheet of parchment paper. Prick the center with a fork leaving a 1-inch border. Brush the edges with a slightly beaten egg and sprinkle with Demerara sugar (or any other sugar). Spread the applesauce in the center and arrange the apple slices on top. Brush the apples with the melted butter and bake for about 40 minutes, or until the edges are golden brown. Let cool.
Melt the apricot jam and brush it all over the tart. Serve warm with vanilla ice cream or whipped cream.