Preheat the oven to 180 °C, 350 F or Gas Mark 4.
Mix the walnuts, sugar, egg and cinnamon in a bowl.
Pull out a small handful of pastry, spread it out and place a tablespoon of filling in the middle in an elongated shape. Wrap it firmly in the pastry, folding both sides inwards and rolling it. It should look like a short, stout cigar.
Arrange the little parcels neatly side by side in a buttered ovenproof dish, with the loose ends underneath. The pastries should not touch each other, otherwise their sides will not crisp. Brush the melted butter all over the top and bake for 30 minutes.
Increase the oven temperature to 200 C, 400 F, Gas Mark 6 and cook for 5 more minutes.
In the meantime, boil the syrup ingredients for 10 minutes, until slightly thickened.
When the Kadaif are cooked, slowly pour the hot syrup over them. Sprinkle some chopped pistachio nuts over them and let them stand in the dish to absorb all the syrup.
The pieces can then be arranged on a platter. Keep them at room temperature, covered to stop them drying out.