Preheat your oven to 325°F. Grease 2 8-inch round cake pans, or line 2 standard 12-cup muffin tins with liners. Set the pans aside.
In a large bowl, place the flour, xanthan gum, cocoa powder, baking soda and salt, and whisk to combine well. Add the brown sugar, and whisk again to combine, working out any lumps in the brown sugar.
Create a well in the center of the dry ingredients and add the water, butter, sour cream, eggs and vanilla, mixing to combine after each addition. The batter will be soft and relatively thick.
Divide the batter evenly between the 2 prepared baking pans, or fill the wells of each muffin cup about 3/4 of the way with batter. Smooth the tops of the batter.
Place the baking pans at the same time, or the muffin tins one at a time, in the center of the preheated oven.
If making cakes, bake for 15 minutes, rotate the pans and continue to bake until the tops spring back when pressed lightly and a toothpick inserted in the center comes out with a few moist crumbs attached (about another 10 minutes for a total of 25 minutes).
If making cupcakes, bake until the tops of the cupcakes spring back when pressed lightly (about 22 minutes).
Remove from the oven and allow to cool for 10 minutes in the tin before transferring to a wire rack to cool completely.