Xiweishu 西魏書 "Book of the Western Wei dynasty" is a history of the Western Wei dynasty 西魏 (535-556), one of the successor states of the Northern Wei 北魏 (386-534). There is no separate official dynastic history of the Western Wei, but this period is included in the Weishu 魏書 (ch. 22), the official dynastic history of the Northern Wei, and the Beishi 北史 (ch. 5), a history of the Northern Dynasties 北朝 (386~581).
The 24-juan long Xiweishu was written by the Qing-period 清 (1644-1911) scholar Xie Qikun 謝啓昆 (1737-1802), courtesy name Yunshan 藴山, style Sutan 蘇潭. He hailed from Nankang 南康, Jiangxi, and rose to the office of governor (xunfu 巡撫) of Guangxi. He wrote a local gazetteer of that province, Guangxi tongzhi 廣西通志, as well as numerous essays that are included in the books Guang jingyikao 廣經義考, Shujintang ji 樹經堂集 and Shujingtang yiwen 樹經堂遺文.
As a historian, Xie Qikun was very disappointed about the neglicence that Wei Shou 魏收 (507-572), author of the Weishu, showed towards the Western Wei empire. He did not write an imperial biography (benji 本紀) for its ruler but only for the ruler of the Eastern Wei dynasty 東魏 (534-550), Yuan Shanjian 元善見 (r. 534-550, ch. 12). Accordingly, Yuan Shanjian is always named with his posthumous honorific title, Emperor Xiaojing 孝靜帝, while Yuan Baoju 元寶炬 (r. 535-551), ruler of the Western Wei, is never called Emperor Xiaowu 孝武帝, but simply "the Emperor of the Western Wei" (Xiwei di 西魏帝). Wei Shou also disregarded the military successes of Emperor Xiaowu in defending his territory against the armies of the Eastern Wei empire. The reason for this is that Wei Shou was a subject of the Northern Qi dynasty 北齊 (550-577), the successor state of the Eastern Wei, and the latter dynasty was therefore perceived as the righteous, while the Western Wei dynasty was considered a usurpatorious line.
Another book on that period, Wei Dan's 魏澹 (580-645) Houweishu 後魏書 from the Sui period 隋 (581-618), is lost except some few fragments. Xie Qikun therefore combed all various kinds of histories and historiographic sources for information about the Western Wei and compiled a specialized book.
The structure of Xie's book follows the official dynastic histories and their biographic-thematic style (jizhuanti 紀傳體) of historiography. There is 1 juan including the biographies of the rulers (diji 帝紀), 3 juan of tables (biao 表) including a listing of the ennobled persons (Fengjue biao 封爵表), a chronological list of events (Dashi biao 大事表), a table containing information about neighbouring states, polities and tribes (Yiyu biao 異域表), 5 juan of treatises (kao 考) dealing with astronomy, rites, administrative geography and state offices, 12 juan of normal and collective biographies (liezhuan 列傳), as well as one juan including the hereditary biographies (zaiji 載記) of Yuan Shanjian, the emperor of the Eastern Wei, and Xiao Cha 蕭詧, Emperor Xuan 梁宣帝 (r. 555-561) of the Western Liang 西梁 or Later Liang dynasty 後梁 (555-587).
Xie Qikun indicated all sources he had used, so that the Xiweishu is a valuable collection of all sources on that period of time. The book was finished in 1791 and was printed by the Shujingtang Studio 樹經堂. In 1899 it was included in the reprint series Shixue congshu 史學叢書, published by the Shanghai Wenlan Press 上海文瀾書局. A modern facsimile published by the Shangwu yinshuguan press 商務印書館 dates from 1938, as included in the first series of the reprint series Congshu jicheng 叢書集成初編.