Subsequently, Zhang Hao tried to send Xu Wen out of the headquarters to be the governor of Zhexi Circuit (浙西, headquartered in modern
Zhenjiang,
Jiangsu), but Yan Keqiu persuaded Xu and Li Chengsi () the deputy military governor of Huainan that Zhang was intending to eliminate them and starting by sending Xu out of the capital; Xu thereafter found excuses to stay at Yang Prefecture. After Zhang then failed in an assassination attempt against Yan, Yan and Xu plotted to overthrow him. Xu subsequently got the officer Zhong Taizhang () to join the plot. On the night of June 18, Zhong took his soldiers and entered headquarters, killing Zhang and his close associates. Xu then blamed the assassination of Yang Wo on Zhang alone, and effectively took over as Yang Longyan's regent as the sole commander of the guards. He entrusted the military matters to Yan and the financial matters to Luo Zhixiang (), and it was said that both Yan and Luo were capable at their jobs, allowing Hongnong to be governed well. Xu himself was said to be calm, resolute, and frugal. While he was illiterate, when he had to rule on legal matters, he would have others read the legal papers to him before ruling on them with proper reasoning. Meanwhile, Xu was hearing rumors that Liu was also planning on resisting him, and prepared for a campaign against Liu. Liu tried to deflect the suspicion by heading to Yang Prefecture, along with Tao, to pay homage to Yang Longyan. Xu treated both Liu and Tao with respect, with ceremonial greetings that would have been due to Yang Xingmi, and further granted them additional titles. He, along with Liu and Tao, then visited Li Yan and requested that Li Yan formally bestow on Yang Longyan the title of Prince of Wu, to make it even more formal than Li Maozhen's commission. Xu himself received the titles of military governor of Zhenhai (i.e., Zhexi) and the honorary
chancellor designation of
Tong Zhongshu Menxia Pingzhangshi (), as well as the commander of Huainan armed forces. He then returned Liu and Tao to their posts, to show that he did not suspect them. In 915, Xu commissioned his oldest son
Xu Zhixun (elder) as deputy commander of the Huainan forces, and then had himself made the commander of the operations against Wuyue as well as acting
Shizhong (), stationing himself at Run Prefecture and leaving Xu Zhixun at Yang Prefecture to govern the general affairs of the state, effectively serving as its junior regent, while he himself still ruled on major matters. Xu Wen was also created the Duke of Qi. In 917, he moved his headquarters to Sheng Prefecture and moved Xu Zhigao to be the military prefect of Run Prefecture. Meanwhile, Xu had ordered the general Liu Xin () to attack
Tan Quanbo the military governor of Baisheng Circuit (百勝, headquartered in modern
Ganzhou,
Jiangxi) — who nominally submitted to both Wu and Later Liang — to try to take Baisheng under control. Liu was able to repel relief forces from Later Liang's vassals Wuyue,
Chu's prince
Ma Yin, and
Min's prince
Wang Shenzhi, but unable to capture Baisheng's capital Qian Prefecture () itself initially. He thus made a peace agreement with Tan. When Liu reported this to Xu, however, Xu was incensed, and, after giving 3,000 soldiers to Liu's son Liu Yingyan (), stated to Liu Yingyan, "Your father is upstream from here, but could not even capture one city with soldiers 10 times the number of defenders. Clearly, he intends treason. Take this army and commit treason with your father!" When Liu Yingyan arrived at Liu Xin's camp and relayed what Xu stated, Liu Xin became fearful, and again put Qian Prefecture under siege. Qian Prefecture fell, and Liu took Tan captive, allowing Wu to take over Baisheng. It was said that, despite his declaring independence under Xu's advice, Yang Longyan was actually displeased about doing so, and after doing so, he began to drink in excess and became ill. In 920, with Yang Longyan becoming seriously ill, Xu Wen returned to Yang Prefecture. Some of his subordinates suggested that he take the throne himself, but he rejected the suggestion. Instead, bypassing Yang Meng, he issued an order in Yang Longyan's name welcoming Yang Meng's younger brother
Yang Pu the Duke of Danyang to serve formally as regent. When Yang Longyan subsequently died, Yang Pu took the throne as king. == Service under Yang Pu ==