In a medium sized pot, heat vegetable oil. Add sliced shallots. Fry until golden. Remove and drain on paper towels. Discard or reserve oil for flavoring other dishes.
In the same pot, melt butter. Add cinnamon stick, star anise, cardamom pods, and cloves. Fry for 1 to 2 minutes until fragrant.
Add rice and stir to combine. Then add golden raisins. Pour in 2½ cups (600ml) water. Bring it to a boil. Season with salt. Cover, reduce heat to medium and allow it to cook for 8 to 10 minutes until all water is absorbed. Reduce heat to the lowest setting and let cook for another 5 minutes. Turn off heat.
Mix ground turmeric with 1 tablespoon hot water in a small dish. In another dish, mix rose essence or kewra water with 1 tablespoon water. Sprinkle both mixture onto rice. Fluff rice gently with spatula.
Cover and allow rice to sit for 10 minutes. Garnish with fried onions and cashew nuts before serving.
Alternatively, nasi biryani may be layered with your favorite meat curries before serving.