Preheat oven to 350°. Line two 8 inch baking pans with parchment paper and spray them with cooking spray. In a large bowl, cream butter and sugar with a mixer. Add eggs and vanilla to butter mixture and mix until fully combined.
- Add flour, xanthan gum (if using), baking soda, baking powder, salt, and cocoa powder.
- Mix until fully combined, scraping down sides as needed.
- Add the milk and mix until fully combined.
- Add the boiling water to the batter and mix until fully combined.
- Pour half of the batter into each pan.
- Bake on the middle rack for 30-35 minutes.
- Check the center of the cake by inserting a toothpick or knife to make sure it is done. You will also see the sides of the cake pulling away from the side of the pan.
- Allow the cakes to cool fully before frosting.