There are a number of substitutes for xanthan gum in baking, including guar gum, agar agar and seeds such as chia or flax. Egg whites are also a substitute for xanthan gum in certain recipes such as pancakes or waffles.
Guar gum is used as an alternative to xanthan gum in most gluten-free recipes, especially pastry fillings and ice cream. It is not a good substitute in yeast breads, however. Agar agar is best used as a substitute for xanthan gum in batters. Chia and flax seed also work well as a xanthan gum substitute and thicken dough and batter easily, but they need to be ground up well to avoid a gritty consistency.