Make the simple syrup. Add the sugar, water, and lemon slices to a saucepan. Bring to a boil, stirring to dissolve the sugar. Reduce the heat to low and simmer for 15 minutes. Remove from the heat and let cool completely.
Prepare the filling. Peel, wash, and coarsely grate the apples into a large bowl. Remove any seeds. Squeeze grated apples out to remove any extra liquid (you can discard this, or drink it - it's real apple juice). Add the cinnamon, walnuts, and optional raisins, then mix well.
Prepare the phyllo. Unwrap the phyllo sheets and melt the butter. Grease your pan with butter generously. Preheat the oven to 480°F (250°C) as you begin assembling the rolls. (If your oven runs hot, lower a little bit.)
Layer the sheets. Place one phyllo sheet on your work surface with the shorter end toward yourself, then brush with melted butter. Place a second sheet directly on top and brush with butter also.
Fill and roll. Spread one-sixth of the apple filling in a horizontal strip across the bottom of the buttered phyllo sheets, spreading it all the way from one side to the other. Roll the phyllo up gently, keeping it snug but not so tight that the phyllo tears.
Cut and arrange. Cut the roll into three equal pieces and arrange them in the prepared pan. Repeat with the remaining phyllo sheets and filling. (You can use a ruler if you need to.)
Bake. Brush the tops with the remaining melted butter. Bake at 480°F (250°C) for about 15 minutes, until the phyllo is nicely golden. (Very important!) Reduce the temperature to 390°F (200°C) and bake for another 15–20 minutes, until the pie is cooked through and evenly browned.Keep an eye on your oven, as baking times may vary. If your oven runs hot, lower the initial temperature or cover the pie loosely with foil once the top has browned. The phyllo should develop a lovely golden color, but don't let it burn. Add the syrup. Remove the pie from the oven and immediately pour the cooled syrup evenly over the hot pastry. Let rest until the syrup has been absorbed and the pie has cooled. (At least 20 minutes.)
Serving. Jabukovača can be served on its own or with a scoop of vanilla ice cream, or alongside coffee. (Pour a tablespoon or two of simple syrup left in the pan over it.) It's great served warm. Storing. Store leftover jabukovača in an airtight container in the refrigerator for 3–4 days.Reheating. Reheat gently before serving. The syrup-soaked phyllo will be softer than freshly baked pastry.