Thoroughly rinse the mushrooms. If they are large, halve or quarter them.
Put the mushrooms in a saucepan with the stock or Madeira and the lemon juice. Cover the saucepan and simmer for 10 minutes.
Drain the mushrooms and reduce the cooking liquid to about 2tablespoons (30milliliters).
Purée the mushrooms, the xanthan gum, if using, and the cooking liquid in a food processor for about 3 minutes. Scrape the sides of the food processor every 15 seconds. Force the purée through a drum sieve with a plastic pastry scraper. Keep the purée well covered with plastic wrap until needed.