Preheat oven to 425 degrees F. Season tenderloin with pepper and place in a lightly greased roasting pan.
Roast for 30 minutes, or until an instant meat thermometer reads 130 degrees F. Cover tenderloin with foil and refrigerate for 1 hour.
Thaw puff pastry at room temperature for 30 minutes. Reheat oven to 425 degrees F. Beat egg with water and set aside.
Meanwhile, heat oil in a heavy skillet over medium-high heat. Throw in the mushrooms, shallots, and garlic.
Cook, stirring sporadically, until vegetables are wilted and all liquid has been absorbed. Stir in parsley and thyme. Set aside.
Unfold the pastry sheet and place on a lightly floured work surface. Roll out to a rectangle, 4 inches longer and 6 inches wider than the tenderloin. Brush the pastry sheet with some of the egg mixture. Spoon mushroom mixture onto the pastry to within 1 inch of the edges.
Place the tenderloin in the center of the mushroom mixture. Fold the pastry over the meat, sealing the ends and edges. Place seam-side down on a heavy baking sheet. If desired, decorate the pastry with small pastry cut-outs, using the remaining egg mixture as your "glue." Bake for 25 minutes, until pastry is golden, and the meat thermometer reads 140 degrees F.
Transfer tenderloin to a serving platter and garnish with fresh herbs (if using). Allow to stand for 5 minutes before carving into slices.