Monkey was conceived inside a huge stone egg. He found a teacher who taught the Monkey King the "72 transformations" with which he could change his shape and size at will. Monkey acquired the powers of cloud traveling, on a special somerasult cloud using which he could teavel on earth and Heaven with incredible speed. The teacher gave him the name Sun Wukong, which meant monkey who is aware of his emptiness.
Sun Wukong became arrogant and defied Heaven and Hell. The Jade Emperor appealed to the Buddha who kept Sun Wukong imprisoned under the Five Elements Mountain and Sun Wukong remained there for five hundred years.
Five hundred years thereafter, baby Xuan Zhang was born in captivity, and his mother put him in a boat and let it float down the river. The baby was rescued by the Chief Priest of a Buddhist Monastery down the river. Xuan Zhang acquired mastery in Buddhist scriptures.
King Taizong had to spend a brief time in Hell where he withessed the suffering of the souls who were wrongfully sent to Hell. Taizong decided to perform a "Great return to earth. He recruited Xuan Zhang to perform the Great Mass.
Bodhisattva Guanyin told Emperor Taizong to commission somebody to fetch the true scriptures from the west, i.e. from India. Emperor Taizong recruited Master Xuan Zhang to the task. Xuan Zhang was accompanied by Sun Wukong, the pig or Zhu Bajie, and the demon of the Flowing Sands River, Sha Wukong, on this epic journey. They encounter countless demons and spirits who impeded their mission. Finally they accomplished their mission and returned safely to China with the scriptures.
The story has many similarities with Indian epics Ramayana and Mahabharata. This inspired the author to rewrite the story pointing out the similarities with Indian epics. The original story is an Chinese and the English translation by Arthur Waley has been taken as the main reference foe this narration, although other reference mentioned in the References section have been of great help.