Preheat your oven to 350°F (175°C).
In a saucepan, combine water, brown sugar, cinnamon, and anise seeds; bring to a boil.
Reduce heat and simmer for 10 minutes, then remove from heat.
In a baking dish, layer half of the cubed bolillo bread.
Add half of the raisins, almonds, walnuts, and shredded coconut.
Pour half of the syrup over the bread and toppings.
Repeat the layering with the remaining ingredients.
If using cheese, sprinkle it on top before the final layer of syrup.
Bake in the preheated oven for 30-45 minutes until golden brown.
Let it cool slightly before serving; enjoy warm or at room temperature.