Xuanguailu 玄怪錄 "Mysteries and monsters" is an ancient collection of stories about supernatural events compiled by the Tang period 唐 (618-907) writer and politician Niu Sengru 牛僧孺 (780-848). There is commonsense that the Xuanguailu must have been an early book by him, although some stories take place during the Dahe 大和 reign (827-835). The Xuanguailu is an early collection of the genre of chuanqi 傳奇 novellas that tell of strange persons and extraordinary incidents. Compared to earlier stories about weird occurrences, the language of the Xuanguailu is very elegant and refinded, and the stories are written in a coherent style so that they might already called novellas and not tales. Personal characters, their dialogues and activities are vividly and explicitly described. Very outstanding is the banquet in the story Liu Feng 劉諷 in which women start quarreling, or the story Yuan wu you 元無有 in which four monsters are performing a song, or the paradise described in the story Gu yuan zhi 古元之. Another, often-quoted story is Guo Daigong 郭代公 in which the protagonist kills a harmful pig ghost harming the population.
The 10 juan "scrolls" long Xuanguailu is first mentioned in the imperial bibliography in the official dynastic history Xintangshu 新唐書. During the Song period 宋 (960-1279) it was commonly called Youguailu 幽怪錄, in order to avoid the personal name of Emperor Taizu's 宋太祖 (r. 960-975) grandfather, Xuanlang 玄朗. It survives as a 4 juan long print from the Ming period 明 (1368-1644), as well as in some fragments quoted in the encyclopedia Taiping guangji 太平廣記. In some editions stories of Li Fuyan's 李復言 sequel Xu xuanguailu 續玄怪錄 are mixed with those of Niu Sengru's Xuanguailu, especially the stories Du Zichun 杜子春 and Zhang Lao 張老.
Niu Sengru's book is called Youguailu in the reprint series Longwei mishu 龍威秘書 and Shuofu 說郛 (Wanwei biecang edition), but the author is called Wang Hun 王惲, while Niu's name is mentioned in the edition in the Jin-Tang xiaoshuo changguan 晉唐小說暢觀, Wuchao xiaoshuo 五朝小說, Wuchao xiaoshuo daguan 五朝小說大觀, Tangren shuohui 唐人說薈, and Tangdai congshu 唐代叢書, while no author is mentioned in the Shangwu Yinshuguan 商務印書館 edition of the Shuofu. 17 paragraphs are quoted in the reprint series Jiu xiaoshuo 舊小説.
The collection Heke sanzhi 合刻三志 includes a text called Xuanguailu that was compiled by the Ming period 明 (1368-1644) collector and publisher Tao Zongyi 陶宗儀, who was also the compiler of the Shuofu. The series Shuofu xu 說郛續 includes paragraphs from a Xuanguailu attributed to Tian Rucheng 田汝成.