Xie Xuan was a scion of the influential
Xie clan of Chen. His father Xie Yi (謝奕), was the elder brother of the Jin prime minister
Xie An. Xie Xuan's sister
Xie Daoyun (謝道韞) was known for her literary talent and quick wit. Early in his career, both Xie Xuan and his uncle Xie An served on staff of the paramount general
Huan Wen. Huan Wen greatly prized Xie Xuan's ability, and once commented, with regard to him and his colleague
Wang Xun (王珣), both of whom served as his secretaries: :''By age 40, Mr. Xie will possess a great general's banner and staff, and Mr. Wang will be a prime minister even while his hair is black. Both are uncommon talents.'' After Huan Wen's death in 373, Xie Xuan initially served on the staff of Huan Wen's brother
Huan Huo. In 377, when the imperial government was looking for a general capable of defending the northeastern border (modern
Jiangsu) against Former Qin, Xie An, against the usual custom of not recommending one's own clan members, recommended him. The official
Xi Chao, who ordinarily feuded with Xie An on nearly all matters, immediately remarked, "Xie An, in his good judgment, made an uncommonly good move against public sentiment, and Xie Xuan would surely not fail his expectations." Xi made these remarks based on the time when he also served on Huan Wen's staff and saw Xie Xuan's abilities. Xie Xuan recruited elite soldiers, and among the ones that joined him was
Liu Laozhi (劉牢之), who in later campaigns served as his assistant and forward commander. Eventually, Xie put together an army that was the most elite of the Jin forces, known as the Beifu Forces (北府兵). His army first distinguished itself in 378, when Former Qin forces made simultaneous attacks on the important Jin cities Xiangyang (襄陽, in modern
Xiangfan,
Hubei), Weixing (魏興; southeast of present-day
Suqian,
Jiangsu), and Pengcheng (彭城, in modern
Xuzhou,
Jiangsu). Xiangyang and Weixing fell to Former Qin, as did Pengcheng, but Xie, charged with relieving Pengcheng, made a fierce counterattack in 379, defeating the Former Qin generals Ju Nan (俱難) and Peng Chao (彭超) and recapturing Pengcheng. This was the first major victory that Jin had over Former Qin in decades, and it was a major morale booster. == The Battle of Fei River ==