In a medium mixing bowl, cream together the coconut oil (or butter) and sugar substitute with an electric mixer until light and fluffy.
Add the eggs, one at a time while mixing on low speed, then add yolks. Continue to beat on low for another minute or two. The mixture should be smooth and creamy.
Next, add the coconut milk and coconut extract, continue to beat on low speed until incorporated. At this point, you are going to think that I have lead you astray. The mixture will look lumpy and broken, but keep going :)
Transfer to a medium-sized saucepan and place over low heat. Whisk until the mixture is heated through and no longer has a curdled appearance.
Stir in the Shredded coconut flakes if using
Increase the heat to medium-low and stir constantly, using a rubber spatula being sure to also scrape the bottom and sides of the saucepan, until the mixture thickened to a pudding-like texture. You may be tempted to increase the heat in order to cook this curd faster - DON'T DO IT! Slow and steady is key and heating the curd too quickly will make it eggy.
Remove from heat, sprinkle the Xanthan Gum on top and whisk it in.
Transfer the mixture to a dish and place it in the fridge to cool. At this point, it is ready to serve, but it will thicken more as it cools.