In a bowl combine the walnuts, sugar and cardamom. Butter a 9 by 9 by 1 3/4-inch baking dish. Cover phyllo with a very lightly dampened towel and keep covered at all times when it is not being used. Cut phyllo into 8 by 11-inch sheets. Place 1 sheet at a time on a work surface and lightly brush with butter. Place 2 tablespoons of the spiced sugar-nut mixture lengthwise down the center of each leaf of phyllo. Fold each sheet over several times lengthwise to form a 1-inch wide strip, enclosing the filling. Roll up each strip to make a coil and place flat (coil side up) in the prepared dish against the side to prevent it from uncoiling. Repeat the whole procedure with the rest of the phyllo sheets. Brush with butter and bake in a preheated 350 degrees F oven for 40 minutes.
Combine all of the ingredients, except nuts, and bring to a boil. Simmer for 30 minutes, cool for 10 minutes, then strain. Pour over pastries once they have come out of the oven and let soak for 1 hour. Sprinkle with walnuts or pistachios.