How do you free the spirit in the tree in The Witcher 3?

Quick answer: Bring a raven’s feather, the remains from the druidess’s grave west of the hillock, and a black mare tamed with Axii, then finish the ritual in the cave.
Show walkthrough (quest spoilers)
Raven’s feather
You usually already have one from Ladies of the Wood, where you helped Johnny the godling get his voice back. If not, raven feathers are common loot. Check your inventory before you go looking.
Remains from the grave
The remains are in the druidess’s grave to the west of the hillock. Use your Witcher Senses to spot the glowing grave marker. Be ready for monsters nearby before you dig.
Black mare
Find the wild black horse to the south of the hillock. Cast Axii on it to calm it, then mount it. Ride it into the cave through the back entrance.
Do the ritual
Give the items to the spirit and pick the option to complete the ritual. The spirit takes over the mare, promises to free the orphans and leaves the cave. You can still attack or trick it at this point if you change your mind.
