Preheat the oven to 450°. Rub the tenderloin with salt and pepper and brush it lightly with oil. Heat a skillet over medium-high heat and lightly sear all surfaces of the meat, including the ends. Remove the meat from the pan and set aside. Melt the butter over high heat; add the shallots and garlic and saute for 2 to 3 minutes. Add the mushrooms and sauté for 2 to 3 minutes longer. Add the oysters and sherry, and cook until the oysters are opaque. Remove from the heat and allow to cool slightly. Drain off any liquid and combine the mixture with the breadcrumbs in the bowl of a food processor. Process until well blended and nearly smooth. Line a colander with several layers of cheesecloth and spoon the pate into it. Allow to drain for 10 to 15 minutes. If the pate seems too wet, pick up the edge of the cheesecloth, twist it together, and wring out the excess liquid.
Roll the puff pastry dough out on a lightly floured surface to form a rectangle less than 1/4 inch thick. Spoon some pate into the center of the dough and spread it to form a shape similar to that of the tenderloin. Place the meat on the pate, then cover the top and sides of the meat with the remaining pate. Wrap the pastry around the tenderloin, overlapping the edges to form a seam. Moisten the edges with water and pinch lightly to seal. Trim the top layer of pastry from both ends and fold the ends up over the sides of the meat, sealing as before. Carefully turn over the pastry wrapped tenderloin and place seam-side down on a lightly greased baking sheet. Brush with the beaten egg. Decorate the top with designs cut from the pastry scraps, if desired. Brush the cutouts with beaten egg. Bake the tenderloin for 15 to 20 minutes, or until the pasty is golden brown. Remove from the oven and let stand in a warm place of 10 minutes before carving.