Talented scholar Gui Zhongxian is well-known in the city of Luoyang. While visiting a Buddhist temple,Zhongxian encounters Xiyun, daughter of Personnel Minister Cheng Tianguan, who arrives at the temple for worship with her maid, Cuihuan. Xiyun accidentally drops her phoenix-shaped hairpin while looking at flowers. When Zhongxian picks it up and returns it to Xiyun, he is struck by her beauty. Xiyun is likewise impressed by Zhongxian’s graceful bearing. With the help of a woman, Liu, Zhongxian becomes a servant in the house of Tianguan.
At the lantern festival, Zhongxian’s father celebrates his birthday, and Zhongxian takes the opportunity to show his talent. The young man meets Xiyun again, and the two decide to get married. Xiyun givesZhongxian her hairpin as a token. Knowing that her family will never allows her to marry a man without scholarly honor, Xiyun urges Zhongxian to take the imperial examination in the capital, return in glory, and marry her. A prince asks Xiyun’s father to give the hand of his daughter to the prince’s foster son, Bu Qingyun, an imperial academician, and Tianguan agrees. Learning the news, Xiyun decides to run away with Zhongxian.That night, Xiyun’s boudoir happens to catch fire, and Xiyun flees to the capital with her maid.Tianguan assumes that his daughter is dead. In the capital, Xiyun is adopted by Prime Minister Zhou Yingsong.
Later, the emperor makes Xiyun his princess. Zhongxian comes out first in the highest imperial examination and the emperor decides to have him marry the princess. Not knowing who she is, Zhongxiandeclines the offer. Knowing thatXiyun is alive, Qingyun tries to bring up his proposal of marriage again; however, thanks to the emperor, Gui finally marries Xiyun.