Preheat oven to 350 degrees F (175 degrees C). Grease and flour a 9×13-inch baking dish.
Whisk flour, sugar, coconut, walnuts, baking powder, baking soda, xanthan gum, and salt together in a bowl. Add coconut milk, vegetable oil, eggs, and vanilla extract; mix until batter is smooth. Spread batter into the prepared baking dish.
Bake in the preheated oven until a toothpick inserted in the center comes out clean, about 45 minutes.