In his youth, Xiang Lang was a student of Sima Hui alongside Han Song, Pang Tong, Xu Shu and Zhuge Liang. Known for his intelligence, he was appointed as the Chief of Linju County by Liu Biao. Upon Liu Biao's death, Xiang Lang went to serve under Liu Bei.
Service under Liu Bei
After Liu Bei conquered the lands south of the Yangtze River, he put Xiang Lang in charge of all military and civil affairs of Mushan, Yidao, Yiling and Zigui counties. After Liu Bei seized control of Yi Province from Liu Zhang in 214, he appointed Xiang Lang as the Administrator of Baxi Commandery. Later, Xiang Lang was reassigned to serve as the Administrator of Zangke Commandery and then as the Administrator of Fangling Commandery.
In 223, after Liu Shan succeeded his father Liu Bei as the emperor of Shu, he appointed Xiang Lang as a Colonel of Infantry and as Chief Clerk to the Imperial Chancellor, Zhuge Liang. In 225, when Zhuge Liang led the Shu forces on a campaign to pacify rebellions in the Nanzhongregion, he left Xiang Lang in charge of domestic affairs at Shu's imperial capital, Chengdu. In 228, when Zhuge Liang led Shu forces on the first of a series of campaigns against Shu's rival state, Cao Wei, he brought Xiang Lang along and left him in charge of the Shu base at Hanzhong Commandery. The Shu vanguard, led by Ma Su, suffered a devastating defeat at the Battle of Jieting against Wei forces led by Zhang He. Xiang Lang received news of Ma Su's defeat before Zhuge Liang did, but due to his friendship with Ma Su, he did not report it to Zhuge Liang. Later, after Zhuge Liang found out, he was so furious that he dismissed Xiang Lang and sent him back to Chengdu. Some years later, Xiang Lang returned to serve in the Shu government as Minister of the Household. In 234, after Zhuge Liang's death, Liu Shan promoted Xiang Lang to the position of General of the Left and enfeoffed him as the Marquis of Xianming Village in recognition of his past contributions. In 243, Xiang Lang soon resigned and spent the remaining years of his life reading, writing, proofreading and editing various classical texts. By the time of his death in 247, he was one of the foremost book collectors of his time and a major source of influence for many later scholars.