Xiao Yu was born in 574, during the reign of his father Emperor Ming of Western Liang, who claimed the throne of Liang Dynasty but whose territory was limited to a small amount of territory around his capital Jiangling. Emperor Ming was at that time also a vassal of the much larger Northern Zhou, and received protection from Northern Zhou forces against rival Chen Dynasty. In 582, Xiao Yu was created the Prince of Xin'an. He was known for his filial piety.
During Emperor Wen's reign
In or around 582, Xiao Yu's older sister married the Prince of Jin, a son of Sui's founder Emperor Wen of Sui, to be his princess. Xiao Yu followed her to the Sui capital Chang'an, and he became known for studiousness and proper actions there. He was particularly attentive in studying Buddhist sutras and became a devout Buddhist, spending much of his time discussing Buddhism with monks. Displeased with the work ''Essay on Predestination'' , authored by the Liang Dynasty author Liu Xiaobiao , he wrote a work entitled, ''Essay on Non-Predestination'' intended to refute it. The work was praised by the scholars on Yang Guang's staff.
In 585, Emperor Ming died and was succeeded by his oldest son and Xiao Yu's older brother . In 587, when Emperor Wen summoned Emperor Jing to Chang'an to meet him, Xiao Yu's uncle Xiao Yan and brother Xiao Huan , believing that a Sui army sent to Jiangling was intending to attack it, surrendered to Chen. When Emperor Wen heard of this, he abolished Liang and annexed its territory, creating Emperor Jing the Duke of Ju. Liang was at its end, although its imperial clan members, including Xiao Yu, continued to be treated well by Emperor Wen. In 600, after Yang Guang displaced his older brother Yang Yong as crown prince, Xiao Yu continued to serve on Yang Guang's staff, as a guard commander.
During Emperor Yang's reign
In 604, Emperor Wen died -- a death that traditional historians generally believed to be a murder ordered by Yang Guang but admitted a lack of direct evidence -- and was succeeded by Yang Guang . Xiao Yu, whose sister Crown Princess Xiao became empress, was made a military recruiting officer. When, at one point, Xiao Yu became suddenly ill, he ordered that no medical treatment be carried out, believing that this would be a good time for him to be relieved from governmental service. However, when Empress Xiao heard this, she visited him and rebuked him, pointing out that this kind of behavior might in fact bring punishment from Emperor Yang. After he recovered, he became more interested in governmental service, and was at one point made the ''Neishi Shilang'' , the assistant head of the legislative bureau of government, and Emperor Yang entrusted him with many secret matters, as Xiao Yu was his brother-in-law. However, later on he was demoted because he often gave suggestions that offended Emperor Yang.
In 615, when Emperor Yang was visiting Yanmen , on the northern border, Eastern Tujue's Shibi Khan, Ashina Duojishi, launched a surprise attack and put Yanmen under siege. Emperor Yang panicked and did not know what to do. Xiao Yu, who had accompanied Emperor Yang to Yanmen, suggested that messengers be sent to Ashina Duojishi's wife, the Sui princess Princess Yicheng, as Tujue customs dictated that the khan's wife be in charge of military matters at home while he was away. Princess Yicheng subsequently sent false information to Ashina Duojishi, stating that Eastern Tujue was under attack from the north, and Ashina Duojishi lifted the siege. However, after the siege was lifted, Emperor Yang, instead of rewarding Xiao Yu, became embarrassed, stating, "Tujue forces were simply being rebellions and lacked tactical cohesion, and would have soon scattered. Just because they did not do so immediately, Xiao Yu was frightened; this is unforgiveable." He demoted Xiao Yu to the governorship of Hechi Commandery and immediately ordered him to get on his way. When Xiao Yu got to Hechi Commandery, there were agrarian rebels in the mountains, numbering over 10,000, whom the commandery government was unable to control. Xiao Yu reorganized the commandery militia and attacked them, forcing them to surrender. Subsequently, when Xue Ju rebelled at Jincheng Commandery and attacked east, Xiao Yu blocked Xue's path, and Xue was not able to advance further at that point.
During Emperor Gong's reign
In winter 617, the general the Duke of Tang, who had rebelled at Taiyuan earlier that year, captured Chang'an and declared Emperor Yang's grandson the Prince of Dai emperor . Li Yuan assumed power as regent, and he wrote to Xiao Yu, requesting that Xiao submit. Xiao agreed, and was made the minister of census and created the Duke of Song. In spring 618, during an abortive campaign where Li Yuan sent his sons Li Jiancheng and with an army to the eastern capital Luoyang to try to get Sui officials there to submit, Xiao served on Li Shimin's staff.
During Emperor Gaozu's reign
Also in spring 618, Emperor Yang was killed at Jiangdu in a coup lead by the general Yuwen Huaji. When the news reached Chang'an, Li Yuan had Emperor Gong yield the throne to him, establishing Tang Dynasty as its Emperor Gaozu. He made Xiao Yu ''Neishi Ling'' , the head of the legislative bureau of the government and a post considered one for a , and he entrusted Xiao with some of the most important matters of state. Whenever Emperor Gaozu held imperial gatherings, he would allow Xiao to sit next to him, and particularly, because Xiao had married a member of the Dugu clan, from which Emperor Gaozu's mother Lady Dugu also came, Emperor Gaozu referred to him endearingly as "Master Xiao." Xiao took the matters of state seriously and was not afraid of offending others in offering suggestions, and people feared him. When Li Shimin was made the governor of the capital prefecture Yong Prefecture , Xiao was given the additional title of commandant of Yong Prefecture. In 619, he and Pei Ji were in charge of interrogating one of the major initial contributors to Emperor Gaozu, Liu Wenjing, who had been arrested on suspicion of treason. Both he and Li Gang , as well as Li Shimin, tried to intercede on Liu's behalf, but Emperor Gaozu nevertheless executed Liu on Pei's recommendations. Later, after the legislative bureau was renamed ''Zhongshu Sheng'' in 620, Xiao Yu remained its head with the new title of ''Zhongshu Ling'' . Per Xiao's recommendations, Emperor Gaozu made Feng Deyi ''Zhongshu Ling'' as well, sharing the position with Xiao. In 621, he was similarly put in charge, along with Pei and Chen Shuda, of interrogating Li Zhognwen the Duke of Zhenxiang, who was also charged with treason, and while Xiao's recommendations were unclear, Li Zhongwen was also executed.
At times, when Emperor Gaozu issued edicts, he wanted the legislative bureau to promulgate them quickly, but Xiao did not do so. When Emperor Gaozu rebuked him, Xiao pointed out that during Emperor Yang's reign, the edicts were issued quickly, and while officials had valid reservations, they did not dare to speak against it. He wanted the edicts to be issued only after greater examination, and so was not issuing them as quickly. Emperor Gaozu agreed. Meanwhile, as Xiao's property was initially seized by Emperor Gaozu when he first entered Chang'an to be awarded to the military officers with accomplishments, Emperor Gaozu returned the property to Xiao. Xiao divided the property and distributed it to his clan members, only keeping the family shrine so thathe could sacrifice to the ancestors. After Li Shimin destroyed a major rival, Wang Shichong the Emperor of Zheng, in 621, Xiao, who served under Li Shimin during the campaign and was credited with some of the strategies , was given 2,000 additional households as part of his fief and made one of the deputy heads of the important executive bureau of government , ''Shangshu Pushe'', still considered a chancellor position. As ''Shangshu Pushe'', Xiao was considered diligent but biased, as well as harsh, and he did not have as good of a reputation.
In 626, when Fu Yi the director of the imperial astronomical observatory, a Confucian, submitted a proposal to ban Buddhism on the grounds that Buddhism was leading to corruption and abuses within the government, Xiao, as a devout Buddhist, debated with Fu earnestly before Emperor Gaozu. He was unable to prevail over Fu in the debate, and Emperor Gaozu issued an edict severely limiting the number of Buddhist temples, although the edict did not appear to be seriously carried out.
Later in 626, Li Shimin, then in an intense rivalry with Li Jiancheng, who had been made crown prince as the oldest son, feared that Li Jiancheng was about to kill him. He submitted a secret petition to Emperor Gaozu accusing Li Jiancheng and another brother, Li Yuanji the Prince of Qin, who supported Li Jiancheng, of committing adultery with Emperor Gaozu's concubines and plotting to kill him. Emperor Gaozu, shocked by the accusations, summoned Xiao, along with Pei and Chen, to prepare to act on the accusations the next morning. Meanwhile, Li Shimin set an ambush for Li Jiancheng and Li Yuanji at outside Emperor Gaozu's palace, and when Li Jiancheng and Li Yuanji approached Xuanwu Gate in the morning, Li Shimin killed them, and then sent his general Yuchi Jingde into the palace, claiming to be protecting Emperor Gaozu. Emperor Gaozu, realizing how serious the situation was, asked Pei, Xiao, and Chen for advice, and Xiao and Chen advised him to create Li Shimin crown prince to placate him. Emperor Gaozu did so, and two months later passed the throne to Li Shimin, who took the throne as Emperor Taizong.
During Emperor Taizong's reign
Initially, Xiao Yu remained chancellor, but was soon conflicting with Feng Deyi, who was also chancellor, as ''Shangshu Pushe'' , over Feng's frequent changes of things that they had already agreed on, as well as some other new chancellors that Emperor Taizong had trusted and commissioned, including Fang Xuanling and Gao Shilian. In anger, Xiao submitted a secret petition to Emperor Taizong denouncing Feng, but the petition was inartfully written, offending Emperor Taizong. Meanwhile, an incident occurred where Xiao and Chen Shuda argued before Emperor Taizong, and both were removed from their posts. In summer 627, however, after Feng's death, Emperor Taizong against made Xiao ''Shangshu Pushe''. Later that year, Emperor Taizong discussed attacking Eastern Tujue, which Xiao favored, but Zhangsun Wuji opposed, and therefore Emperor Taizong did not carry out the attack. However, when Emperor Taizong asked Xiao how he felt that the life of the dynasty could be extended, Xiao suggested enfeoffing the imperial princes, and Emperor Taizong agreed and began considering doing so. Around the new year 628, Xiao was again removed from his position, for reasons not stated in history, although in spring 630 he was made a de facto chancellor as imperial censor. Later that year, he accused the general Li Jing, after defeating and capturing Eastern Tujue's Jiali Khan Ashina Duobi, of allowing his soldiers to plunder Tujue's treasures, but Emperor Taizong took no actions against Li Jing, on account of Li Jing's great accomplishment. Meanwhile, Xiao continued to be arrogant and harsh and was again not getting along with the other chancellors. It was said that when Fang, Wei Zheng, and Wen Yanbo had minor faults, Xiao submitted accusations against them which Emperor Taizong did not act on, and Xiao became displeased from it. In fall 630, Emperor Taizong made him an advisor to his son and crown prince Li Chengqian, no longer a chancellor.
In 634, Emperor Taizong commissioned 13 officials to examine the circuits in the empire, to see whether the local officials were capable, to find out whether the people were suffering, to comfort the poor, and to select capable people to serve in civil service. Xiao Yu was made the examiner of Henan Circuit , but on his mission, he overly punished an official who did not listen to the people under him about their suffering by putting him in a block, causing that official's death. Emperor Taizong, however, did not punish him. In 635, Emperor Taizong again made him de facto chancellor, once stating:
:''After the sixth year of the ''Wude'' era , Emperor Gaozu considered deposing the crown prince and making me crown prince, but could not resolve to do so. I was not tolerated by my brothers, and I often feared that instead of being rewarded for my accomplishments, I would be punished. But Xiao Yu was not tempted by material goods or threatened by death, and he was truly a pillar for the empire.''
He also wrote a poem to Xiao Yu, including these two lines:
:''Only in a gust of wind can the strong among the grass be known,''
:''Only in turmoil can the faithful subjects be seen.''
He further stated to Xiao, "Your faithfulness and honesty cannot be exceeded even by the holy men of old times. However, your overzealousness to distinguish good and bad sometimes makes you difficult to tolerate."
In 643, Emperor Taizong commissioned 24 portraits at Lingyan Pavilion to commemorate the contributions of the 24 great contributions to Tang Dynasty. Xiao's was one of the portraits. Later that year, Li Chengqian, fearful that Emperor Taizong was considering replacing him with his younger and more favored brother Li Tai the Prince of Wei, plotted with the general Hou Junji to overthrow Emperor Taizong. When the plot was discovered, Emperor Taizong commissioned Xiao, along with Zhangsun, Fang, Li Shiji, and officials from the supreme court, the legislative bureau, and the examination bureau, to investigate. As a result of the investigation, Hou and many other conspirators were ordered to commit suicide or were executed, while Li Chengqian was reduced to commoner rank. Soon thereafter, Emperor Taizong, believing that Li Tai had played a role in Li Chengqian's downfall, created another son, the Prince of Jin, crown prince, instead of Li Tai, and Xiao was made a senior advisor of the new crown prince. Xiao was given a newly created title for a de facto chancellor as well, ''Tong Zhongshu Menxia Sanpin'' . In 645, when Emperor Taizong commanded a major campaign against Goguryeo, he put Xiao in charge of Luoyang as well as the logistics of shipping supplies to the frontline.
In 646, Xiao was again in discord with the other chancellors, going as far as accusing Fang of factionalism bordering on treason. Emperor Taizong was also displeased with Xiao over his requesting to become a Buddhist monk at one point around this time and then changing his mind. In winter 646, he issued an edict extensively accusing Xiao of being overly obsessed with Buddhism -- citing Xiao's ancestor Emperor Wu of Liang and Emperor Wu's son Emperor Jianwen of Liang as examples that Xiao was falling into the traps of. He demoted Xiao to the post of prefect of Shang Prefecture , but also cancelled Xiao's title as Duke of Song. In 647, however, Emperor Taizong recalled Xiao to be an imperial advisor and restored his title of Duke of Song.
In 648, while accompanying Emperor Taizong at Yuhua Palace , Xiao grew ill and died. The ministry of ceremonies suggested, as a posthumous name, De , while the executive bureau suggested Su . Emperor Taizong, however, disagreed with both, stating that posthumous names should be particularly reflective of people's characters, and he chose Zhenbian instead.