Forest of the Dead ( TV story ) Forest of the Dead was the ninth episode of the fourth series of " Doctor Who " . Its major impact on the mythos of " Doctor Who " was its depiction of the death of River Song . This narrative end point would be respected in future series that told River Song ' s out - of - sequence story . In overview , this would have been the Doctor ' s final adventure if River hadn ' t been there to sacrifice herself in his place . This was one of the first known consequences of the Kovarian Chapter ' s failed attempts to prevent the Siege of Trenzalore by killing the Doctor earlier in his timeline . They kidnapped River as a child and raised her to be his assassin ; however , she fell in love with the mad Time Lord instead , sharing many adventures with him . Though the Doctor leaves River Song ' s diary behind at the end of the story to avoid causing paradoxes , it would later be recovered by her assistant Nardole . This episode also introduced the red herring of the Doctor ' s next incarnation being the one who River saw before she came to the library . It wouldn ' t be until 2015 that it was revealed that the Doctor would had this meeting with River came two regenerations later . Synopsis . Donna is gone , the Vashta Nerada are out for fresh meat and the Tenth Doctor is running out of options . Can he trust the mysterious Professor River Song , a woman who claims to be from his future ? Why would his future self have given her his sonic screwdriver , or tell her his real name ? Even if they do work together , can anyone stop the shadows from claiming them all as their next meal ? Plot . River Song uses her sonic blaster to create a hole in the wall . The Tenth Doctor and the others escape the Vashta Nerada - possessed Proper Dave down a corridor . These events are watched on television by the girl . She switches channels to one showing Donna being taken out of the ambulance on a stretcher . Donna wakes up in a facility being treated by Doctor Moon . When she tries to remember reality , Doctor Moon quietly tells her that she has been in this facility being treated by him for years . She accepts the reality he presents to her . The way time progresses in her virtual world seems to be led by her thoughts ; Doctor Moon suggests she walks by the river and she suddenly appears at the river . She occasionally finds this odd , but is reassured by Doctor Moon . He introduces her to another resident named Lee , who has a stammer . Before she knows it , she is married to her ideal man , and they have two children . She is contacted by a hooded figure , who tells her the world is not real . They arrange to meet in a playground . The figure reveals herself to be Miss Evangelista , whose consciousness was copied when she was killed . In this reality however , she has become much more intelligent . She again warns Donna that the world is not real . Donna is stubborn and sceptical , but to her horror she sees that all the children in the playground – including hers – are identical . This revelation drives the little girl into hysterics , making her father and Doctor Moon disappear with her TV remote . The Library starts to enter a meltdown , and is set to explode . Meanwhile , the others in the Library have been on the run from the Vashta Nerada . The Doctor and River Song argue . He isn ' t sure he can trust her , but she assures him that someday she ' ll be someone he trusts completely . She says she can prove it and whispers something in his ear . He is stunned , and when she asks him if they ' re OK now , he nods in response , seeming to now trust that she ' s telling the truth . Unfortunately , Anita now has two shadows . She remains brave in the face of her impending death , as the Doctor darkens her visor in the hopes that it might trick the Vashta Nerada into thinking they have already infiltrated it . They then realise that " Proper Dave " has caught up with them again , and they flee . The Doctor stops to try to reason with the Vashta Nerada . River tells Other Dave to stay behind to help the Doctor , who teaches the Vashta Nerada to use the suit ' s communicator to speak to him . In doing so , he learns that they came as micro - spores in millions and millions of book s , and then hatched . Other Dave , in the meantime , has also been killed by the Vashta Nerada , leaving the Doctor trapped between the two Daves . He escapes through a trap door hatch , and sets off after the other three . Elswhere , River Song is telling Anita about the Doctor she knows . She has seen whole armies turn and run away from him in the future , and he can open the TARDIS by snapping his fingers . The Doctor arrives , and says that is impossible . As he returns his attention to the present , Anita asks him what River whispered in his ear earlier . She reminds him that she ' s about to die , and so his secret is " safe " with her . This prompts him to finally realise the significance of the oddly - worded " 4022 saved " message . He figures out that the Library ' s computer hard drive – CAL – literally " saved " all of the four thousand twenty - two people in the Library to its hard drive a hundred years ago , and has done the same with Donna . The team travel to the core of the planet to the computer . The little girl is in fact the hard drive . She was Strackman Lux ' s grandfather ' s youngest daughter , Charlotte Abigail Lux ( aka " CAL " ) . She was dying of an incurable disease , so he made an imaginary world for her to live in and every book ever written for her to enjoy . He also gave her a " Doctor Moon " to watch over her , but the stress of having so many minds integrated into her own is causing her to overload . She has initiated the self - destruct and is about to destroy the planet . The Doctor realises that to restore the " saved " people , the Library needs extra memory . This can be achieved by linking himself to the core . River Song says that this will burn through both his hearts , and kill him without a chance of even being able to regenerate . He sends River and Lux upstairs to prepare for the restoration . As she exits , River tells Anita to watch him . Anita asks the Doctor what he intends to do about the Vashta Nerada . He states he intends to materialise the people , get them off the planet , and then leave the world to the Vashta Nerada . When asked if he thinks the Vashta Nerada will take his offer , he reveals Anita has already been consumed by them . When they , using Anita ' s suit , threaten to consume him and everyone else , he reminds them he is the Doctor . . . They are in the biggest library in the universe , and he tells them to look him up . They pause after a moment of consideration , and then agree : they will give him one day to evacuate everyone . They then abandon the suit and withdraw . River returns to find Anita dead , then knocks the Doctor unconscious . He wakes up , finding himself handcuffed to the wall . River has hooked her own mind up to the computer , planning to carry out the plan in his place . He tries desperately to persuade River to let him do this . He remind her that she whispered his real name into his ear , which he could only tell someone for one reason . . . She refuses , and sadly notes that during all the time they shared and will share together , he always knew this is where and when she dies . While he insists that the future can be changed , she tells him not to change one moment of what happens between them even though it leads to this and he will see her again . She links in when the countdown reaches zero and dies , as the Doctor looks on . Donna and the other saved people return in the library , and begin to be evacuated . Donna cannot find Lee , and she and the Doctor conclude that perhaps he never really existed at all . The real Lee sees Donna as he steps onto a teleport , but his stammer prevents him from calling out to her before he is teleported away . The Doctor and Donna briefly muse over River Song ' s diary , as it contains details of her life and their future . Ultimately , they decide not to look in it , and leave it behind on a shelf along with the sonic screwdriver his future self gave her . Suddenly , the Doctor comes running back . He realises that since he knew River ' s fate all along , his future self would have had years to think of a way to save her . He knows that he wouldn ' t just give her a sonic screwdriver without a good reason . Opening it , he finds that it contains a hidden neural relay . As with the data ghost s , her consciousness has been saved there . However , it is fading . The Doctor takes River for " one last run " , as he sprints back to the core . He uploads River ' s data ghost into the Library ' s computer , as the face of Charlotte looks on and smiles . River appears in a virtual reality created by Charlotte and is reunited with all of her team members for all eternity . The Doctor also fixes the data core so that Charlotte is no longer unstable and it ' s a good place for them to live . In the real world , the Doctor returns to the TARDIS . Standing before it and concentrating , he tries opening the TARDIS doors with a snap of his fingers and is able to do so . He goes inside to join Donna , and turns to look back outside with her . As he snaps his fingers to close the door of the TARDIS , River closes the blue TARDIS - shaped diary . River is sitting in the kids ' bedroom of Donna ' s house in the virtual realm , and has been telling the story of the Doctor to Donna ' s two children , and Charlotte , who has moved to live with them , concluding that on very special days when " the Doctor comes to call , everybody lives . " Charlotte has a real family now , human consciousnesses to keep her company in her " Dream " . Smiling , River turns out the lights , saying " Sweet dreams everyone . "