Preheat oven to 400 degrees F.
In the bowl of a stand mixer (can also use a hand mixer), combine the cream cheese, sugar, and egg yolk. Beat until combined. Scrape down the sides of the bowl with a spatula and add the vanilla extract and almond extract. Beat again until smooth. Cover and place in the refrigerator until ready to use.
Carefully unfold the puff pastry sheets onto a piece of lightly floured parchment paper or a Silpat baking mat. Use a rolling pin to roll out the sheets, 2 additional inches lengthwise, so the sheets are 9x11-inches in size.
Use a sharp knife or scissors to cut off the top 2 corners of each sheet. You don’t need these pieces for the Danish braid, but don’t throw them out. You can sprinkle them with a little cinnamon and sugar and bake them on the side.
Cut 9 or 10 slanting strips (3/4 – 1 inch wide each) into both sides of each pastry sheet. Cut off the two remaining flaps at the bottom of each sheet. Set these extra pieces aside to bake with the top scrap pieces.
Give the cream cheese filling a good stir. Divide the filling in half and spread it down the center each pastry. Spread the raspberry jam on top of the cream cheese filling (2 tablespoons per pastry). Top with fresh raspberries (1/3 cup per pastry).
Start at the top and fold the strips over the filling, alternating each side to resemble a braid. Fold the bottom end and gently press, sealing the filling inside. Carefully transfer the pastries to a large baking sheet. They should fit on one pan. They will puff up in the oven, but not spread too much.
In a small bowl, whisk together the egg and water. Brush the tops of the Danishes with the egg wash, using a pastry brush. Sprinkle with sliced almonds, if using.
Bake for 20 to 25 minutes or until golden brown and puffed up. Remove from the oven and cool completely.
While cooling, make the glaze. In a medium bowl, whisk together the confectioner’s sugar, heavy cream or milk, and almond extract.
Drizzle the glaze over the cooled Danishes. Cut into pieces and serve!