 When Li Shimin was made the governor of the capital prefecture Yong Prefecture (雍州, i.e., Chang'an and its surrounding counties), 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.