Many bread puddings are made with a sugar syrup in place of cream. This is my adaptation of an authentic recipe that has a cream and sugar syrup.
Combine nuts, apples, and raisins. Set aside.
In a medium-size saucepan, combine sugar, water, sherry, if desired, cinnamon sticks, clove, and anise seeds and bring to a boil over medium-high heat. Let boil 2 minutes. Strain and set aside. When cool, mix in cream.
Preheat oven to 350°F (175°C). Butter a 1-1/2-quart casserole (at least 3 inches deep) or soufflé dish. Trim thin portion of top and bottom crusts from the Mexican pastry, if using. Cut it into 1/2-inch-thick slices. Melt about 5 Tbsp butter in a large skillet over medium-high heat. Add pan dulce or bread slices in batches and sauté on both sides until golden, about 2 minutes, adding more butter if necessary. Remove from skillet. Melt the remaining butter.
Arrange 1/3 of the bread in the prepared dish. Cover with 1/2 of the nut filling. Sprinkle with 1/2 of the cheese, then drizzle with 1/2 of the syrup. Repeat layering twice, alternating slices to cover empty spaces. Pour remaining melted butter over top. Press down gently on slices to soak well. Bake at 350°F (175°C) for 30 to 35 minutes. Serve warm with whipped cream.