During the reign of Emperor Jingzong of Liao, the empress Xiao Yanyan often took part in politics and war. She often stationed troops in Yanzicheng (present Zhangbei), the name of which is believed to derive from Xiao Yanyan in preparations for the War against Song. Attracted by the beautiful scenery in Zhangjiakou area, she built two royal gardens, Shanghuayuan () and Xiahuayuan (, in present Xiahuayuan District). Xiao resided there often and enlisted many talent in his war with Song dynasty.