Preheat the oven to 180℃ and line a 9-inch square baking tin with greaseproof paper. Leave a bit of extra paper overhanging so its easier to remove your cake from the tin.
In a large mixing bowl, whisk the castor sugar, oil, eggs, and vanilla extract until they are well combined.
Stir in the gluten-free flour, baking powder, baking soda, xanthan gum, salt, cinnamon, nutmeg, and ginger.
Whisk everything together into a smooth batter, without any clumps.
Add the grated carrots and the roughly chopped-up walnuts, and fold them through the batter.
Pour the batter into your prepared baking tin, making sure it is level.
Bake at 180C for 35 minutes on the middle shelf, or until the cake is golden brown and well-risen. To make sure the cake is fully cooked insert a skewer into the middle, if it comes out clean then the cake is done. If not pop back in and keep checking every five minutes. If the cake begins to brown too quickly then put some aluminium foil over the top and continue to bake until done.
Allow the cake to cool for 10 minutes then fully remove from the tin onto a cooling rack.
To make the frosting whisk the cream cheese until it is smooth and loose.
Add the icing sugar and whisk until soft peaks form.
Spread the cream frosting onto the fully-cooled cake and decorate it with walnut pieces.
Store this gluten-free cake in an airtight container in the fridge for 3-4 days.