Since the thema was a front of the Tang Dynasty against Nanzhao, he was able to get his hands on the updated diplomatic and military documents of the two countries. He also lived in Hanoi during his first tenure therefore he also knew some first hand information of the city, like trades, deployments, population etc. As the Nanzhao army sacked the city for the first time, he just escaped from being captured by jumping into the Red River and swimming to the opposite bank. Then he worked under another Jie-du located at Guangzhou where he compiled the first draft of Manchu (蠻書 man2 shu1). The title literally means the book on the southern tribes. He also worked a second tenure in Hanoi where he finished the book in 862 AD. He died in Guangzhou after retirement. His book, Manchu, is the invaluable source of the Tang-Nanshao relation and for anthropological research of Miao and Vietnam during later years of Tang Dynasty. For instance his eyewitness account on the siege of Hanoi was monumental.
Vietnamese, English and French translations are also available.
See also: Chinese history, Tribes in Chinese history, Miao, Tang Dynasty