Hugh Mitchell's wife handed in his "fictionalised" story to police before he was due to stand trial for sex crimes in West Lothian.
Former soldier Mitchell, 65, pleaded guilty to raping a nine-year-old girl.
He also admitted a further seven charges of indecency involving a total of five underage girls.
A judge told him at the High Court in Edinburgh: "You were repeatedly committing serious sexual crimes against young children over many years."
John Beckett QC said: "You deployed inducement, manipulation and threats to inflict your grossly depraved conduct on innocent children."
The judge said statements provided by the victims made "harrowing reading" and added: "In different ways you have traumatised all of your victims."
He jailed Mitchell, formerly from Kirknewton, for a total of 10 years and 10 months and ordered he be under supervision for a further three years.
First offender Mitchell was also placed on the sex offenders' register for life.
The judge said that he took account of Mitchell's long Army service, his age, health problems and lack of previous offending.
Mitchell abused children at Almondell Country Park, East Calder, and at Bubbles Leisure Pool in Livingston, all in the West Lothian area.
Mitchell, a former classroom assistant at a West Lothian school, began preying on children in 1988 and continued up to 2004.
Defence solicitor advocate Mike Bell said: "I am instructed simply to say it is accepted this indictment involves a quite dreadful catalogue of abuse for which there can be no mitigation."
The court heard that Mitchell's wife had handed in an envelope containing his self-penned book in September this year. She  had come across it about 10 years ago.
Det Ch Insp John Peaston said: "Mitchell is a dangerous predator and it is through the courage of his victims that he has been brought to account. We hope this sentence will bring closure to them and allow them to move forward with their lives.
"The investigation of child abuse, whenever or wherever it has taken place, continues to be a top priority for Police Scotland.
"We would urge any victim of a sexual crime to contact police. All reports are thoroughly investigated by dedicated officers, who provide specialist support to victims and target offenders to bring them to justice."
A child rapist who wrote an account of sexual abuse mirroring his exploitation of a victim has been jailed for more than 10 years.