Though The Ballad of Mulan itself does not expressly indicate the historical setting, the story is commonly attributed to the Northern Wei era due to geographic and cultural references in the ballad. The Northern Wei was a dynasty founded by the Tuoba clan of ethnic Xianbei who united northern China in the 4th century. The Tuoba Xianbei rulers were themselves nomads from the northern steppes and became partially sinified as they ruled and settled in northern China. The Tuoba Xianbei took on the Chinese dynasty name "Wei", changed their own surname from "Tuoba" to "Yuan", and moved the capital from Pingcheng, modern day Datong, Shanxi Province in the northern periphery of Imperial China, to Luoyang, south of the Yellow River, in the Central Plain, the traditional heartland of China. The emperors of the Northern Wei were known both by the sacred Chinese title, "Son of Heaven", and by "Khagan", the title of the leader of nomadic kingdoms. The Ballad of Mulan refers to the sovereign by both titles. The Northern Wei also adopted the governing institutions of Imperial China, and the office of shangshulang the Khagan offered Mulan is a ministerial position within Shangshusheng, the highest organ of executive power under the emperor. This offering indicates Mulan was trained in the martial arts and literary arts as she was capable of serving as a civilian official charged with issuing and interpreting written government orders.