Epic of Manas
Possibly some time in the Middle Ages, Kyrgyz people began telling the story of Manas, his son Semetei, and his grandson Seitek. In the first part, Manas grows up, becomes Khan, gets married to the Uighur princess Kanikei, and leads his people to attack Beijing in China. He is killed, and everything he worked for is lost, but Kanikei rescues their son.
In the second part of the epic, Manas' son Semetei grows up, gets married and fights his own battle against the Khitan. Again, he dies tragically.
In the third part of the epic, Semetei's family is all killed, but his son Seitek escapes the slaughter and grows up. He, too, gets married and fights his enemies. In the third generation, Seitek finally wins his battle and defeats his enemies, but then he, too, dies.
Most likely the story in its current form dates to the 1500s and 1600s, because that's when the Kyrgyz people were fighting with the groups named in the epic.