There's a bit in Harry Potter where he climbs inside a tree. I believe it's the Whomping Willow. There are two bits in The Box of Delights where Kay Harker takes refuge inside a tree. Whilst small he is escorted around by a mouse and whilst large he is led there by a lady. There's an Enid Blyton novel called The Faraway Tree (followed by the sequel The Magic Faraway Tree) that takes place almost entirely inside a tree. Timmy Tiptoes is imprisoned in a tree as you can see from the illustration on the left which terrified me as a child. Owl in the Winnie the Pooh books lives in one.
[There was a Canadian soldier who signed up to fight in World War One. To get to the lovely trenches he had to take a train all the way across Canada. The train stopped at a station in Winnipeg where somebody had a bear cub for sale so the soldier bought it and named it Winnie because it was purchased in Winnipeg. The bear travelled all the way to England, by which time it had become a regimental mascot. However it was deemed unsuitable for frontline combat, so it was left at London Zoo where it was a big attraction under the name Winnie the Bear. A.A. Milne took his son to see it, but his son couldn't pronounce bear and called it Winnie the Pooh instead.]
There's a bit in Lord Of The Rings where one of them (I think Sam) gets almost eaten by a tree. Possibly related: Ariel in The Tempest was imprisoned inside a pine
[Sycorax] did confine thee,
By help of her more potent ministers
And in her most unmitigable rage,
Into a cloven pine; within which rift
Imprison'd thou didst painfully remain
A dozen years; within which space she died
And left thee there; where thou didst vent thy groans
As fast as mill-wheels strike.
A suffering that Prospero threatens to revive:
If thou more murmur'st, I will rend an oak
And peg thee in his knotty entrails till
Thou hast howl'd away twelve winters.
I don't wish to get overly psychoanalytical about this because I'm jung and easily freudened*, but can anybody think of other occassions where people are living or imprisoned inside trees, especially in children's books? It seems to be significant to the infantile mind. Here, for example, is the view from inside the hollow tree I loved to play in as a child.
*James Joyce, whose pun that was, was immensely proud that his name was the same as Freud's which, in German, means Joy (ce). That's why Beethoven's Ode To Joy was lots of people singing freude.