Preparation time 40 minutes
Cooking time 30-35 minutes
Thinly slice 2 of the onions and reserve the third for later. Heat 1 tablespoon of oil in a frying pan, add the sliced onions and 1 tablespoon of the rosemary and fry gently for 10 minutes, stirring until just beginning to turn golden.
Meanwhile, bring a saucepan of water to the boil, add the sliced potatoes and cook for 4-5 minutes until just tender. Drain and return to the pan then leave to cool for 5 minutes.
Add the crème fraiche, cheese, garlic and some salt and pepper to the potatoes and gently mix together then add the onions and mix once more, being careful not to break up the potato slices.
Cut the pastry into 6, then roll one piece out on a lightly floured surface until a rough shaped 18cm/7inch square. Lay one of the slices of ham on top then pile one sixth of the potato and onion mix on top.
Brush the edges of the pastry with a little egg then gradually bring up the edges, pleating the ham and pastry up and over the filling to enclose completely, pinch the edges together in the centre and trim off the excess pastry. Put the parcel on to an oiled baking sheet and repeat to make six parcels.
Brush the outside of the parcels with beaten egg. Cut the remaining onion into 6 slices then put a slice on top of each pastry parcel. Brush with the remaining oil then sprinkle with the remaining rosemary and a little salt and pepper.
Bake in a preheated oven set to 200°C/400°F/Gas 6 for 30-35 minutes until golden brown and the pastry is cooked through. Serve warm with a mixed leaf salad.