01 - Preheat oven to 400°F. Line a baking tray with parchment paper.
02 - In a skillet over medium heat, melt the butter. Add diced apples, brown sugar, cinnamon, nutmeg, and lemon juice. Cook for 6–8 minutes, stirring often, until apples are soft and syrupy. Let cool.
03 - Beat together cream cheese, sugar, and vanilla extract in a bowl until smooth.
04 - Roll out puff pastry on a floured surface to smooth any creases. Cut into 8 equal squares.
05 - Place pastry squares on prepared baking tray. Lightly score a smaller square inside each (do not cut all the way through), and prick the center with a fork.
06 - Spread a spoonful of cream cheese filling in the center of each pastry, keeping inside the scored square. Top with a generous spoonful of cooled apple mixture.
07 - Brush pastry edges with beaten egg.
08 - Bake for 18–22 minutes, or until golden brown and puffed.
09 - Allow to cool slightly. For icing, mix powdered sugar with enough milk or lemon juice to make a drizzle; use a spoon to zigzag over cooled danishes if desired.
10 - Serve warm or at room temperature.