Place coconut and walnuts (or dried dates and dried figs), apricots, and raisins in a food processor. Add sugar and cinnamon. Process until finely chopped.
Place the phyllo sheets on a clean work surface. Cover with a damp towel to prevent it from drying out—brush 1 sheet of the pastry with melted butter. Fold in half, pressing into the pan.