Yu Xuanji (, c840–c868), courtesy names Youwei () and Huilan (), was a Chinese courtesan and poet of the late Tang dynasty, from Chang'an. She was one of the most famous women poets of Tang, along with Xue Tao, her fellow courtesan.

Biography
Little trustworthy information is known about the relatively short life of Yu Xuanji. She was born or grew up in Tang capital Chang'an, which was the terminus of the Silk Road and one of the most sophisticated cities of its time. Yu was married as a concubine, or lesser wife, to an official named Li Yi () at 16, separating three years later because of Li's primary wife's dislike of Yu.

She became a courtesan and had a "painted boat" on the Wei River. Yu later took her vows and became a Daoist nun at the Xianyi guan (咸宜觀, Abbey of Universal Benefit). Daoist nuns were at the time known for their sexual freedom and, as was common at the time, Yu continued as a courtesan. During her time as a nun she travelled frequently and her travels influenced her writing. Yu had a reputation for being sexually adventurous and is recognised by some as China's first openly bisexual female.

She was a fellow of Wen Tingyun, to whom she addressed a number of poems. Apart from names and dates in her poems, the tabloid-style Little Tablet from the Three Rivers, (), gives the only purported facts about her life. These are however salacious in detail: it reports she had an affair with Wen Tingyun, lived a scandalously promiscuous life, and  was executed by decapitation at the age of 28 for allegedly strangling her maid, Luqiao, to death. This account is considered semi-legendary, and may be a reflection of the traditional distrust of women who were strong-willed and sexually independent.

Poetry
Yu Xuanji is distinctive for the quality of her poems, including many written in what seems to be a remarkably frank and direct autobiographical style; that is, using her own voice rather than speaking through a persona. In her lifetime, her poems were published as a collection called Fragments of a Northern Dreamland, which has been lost.  The forty-nine surviving poems were collected in the Quan Tangshi, mainly for their freak value in an anthology that also included poems from ghosts and foreigners.

English translations
Published in 1998, her work was translated by the team of David Young and Jiann I. Lin. In the 2000s, her work was translated by Stephen Owen and Justin Hill.

Name
Her family name, Yu, is relatively rare. Her given name, Xuanji, means something like "Profound Theory" or "Mysterious Principle," and is a technical term in Daoism and Buddhism. "Yòuwēi" means something like "Young and Tiny;" and, Huìlán refers to a species of fragrant orchid.

Media
In 1984 the Shaw Brothers Studio in Hong Kong made a film about her life entitled 唐朝豪放女 (An Amorous Woman of Tang Dynasty), starred Pat Ha and Alex Man.

In 1988, the Asia Television Limited in Hong Kong filmed an anthology drama series about her life, titled 歷代奇女子 (Those Famous Women in Chinese History), starred Bonnie Ngai, Pat Poon and Kingdom Yuen

Yu Xuanji is the subject of the 1915 short story Gyogenki by Japanese author Mori Ōgai. She was the nun in Robert van Gulik's 1968 "Judge Dee" novel Poets and Murder.

Justin Hill's Somerset Maugham Award award-winning novel Passing Under Heaven reimagines Yu Xuanji's life.

References

Sources
 
 Fu, Shousun, "Yu Xuanji". Encyclopedia of China (Chinese Literature Edition), 1st ed. Archived from the original on 29 September 2007. 
 
 
 
 

840s births
869 deaths
9th-century executions
9th-century Chinese poets
9th-century Chinese women writers
Chinese courtesans
Chinese women poets
Executed Chinese women
Executed people from Shaanxi
Executed Tang dynasty people
People executed by the Tang dynasty
Poets from Shaanxi
Tang dynasty poets
Tang dynasty Taoists
Writers from Xi'an
Taoist nuns
9th-century Taoists