Preheat oven to 350° F.
Line the bottom of a 10-inch tart pan with parchment paper.
Roll the puff pastry sheet out until it is big enough to cover the tart pan. Lay the rolled out puff pastry dough in the prepared tart pan (a shallow pie dish works well too) and trim the edges using the edge of a rolling pin rolled across the top.
Put the pastry in the tart pan in the freezer while you prepare the filling.
Melt butter in a medium skillet over medium heat. Add onions and saute until translucent.
Add sliced mushrooms, rosemary and minced garlic, and continue to cook until mushrooms release their juices. (I usually add a pinch of salt to the mixture to encourage the process.) When the pan is very juicy-looking, add the chopped walnuts. Continue to cook until all the liquid is absorbed.
[Note: At this point, I sometimes add about 1/4 cup white wine to the mixture and reduce it again, but this is totally optional.]
Season to taste and set aside to cool.
In a medium bowl, mix cream cheese and eggs together until smooth.
Remove the pastry from freezer and fill the bottom of the tart with the cooled mushroom mixture.
Top with shredded chicken.
Using a spatula, "frost" the top of the tart with the cream cheese and egg mixture.
Bake for 40-45 minutes, until the top begins to brown and the egg mixture is firm.
Remove from oven and cool slightly before cutting.