The third night of the sixth month of 626, in Changan. Two men in Daoist robes stood at the back gate of the house of the Prince of Qin.
One was Fang Xuanling. The other was Du Ruhui. Both wore the loose grey robe and the knotted hair of wandering priests, so that anyone watching the alley would see two nameless men of no consequence.
They had been members of the household of the Prince of Qin until a month earlier. Then the emperor ordered them out and forbade them to come back.
The man who had them expelled was the crown prince, Li Jiancheng.
The man who now wanted them was the prince, Li Shimin.
The officer who came to fetch them was Yuchi Jingde, and he came armed.
Fang and Du hesitated. An imperial order forbids us to serve the prince any longer, they said. If we go in privately tonight, we are defying that order.
Yuchi Jingde carried the answer back. Li Shimin unsheathed the knife at his belt, handed it to him, and said: if those two will not come, bring me their heads.
Only then did the two men put on their robes and follow him in.
What they planned that night under the lamp happened the next morning at the Xuanwu Gate.
A Degree at Eighteen
Fang Xuanling was born in 579, in Linzi in Qizhou, which is part of Zibo in Shandong.
His family had served governments for generations. His great grandfather had been a general and a commandery governor under the Northern Wei. His grandfather had been a registrar. His father, Fang Yanqian, was magistrate of Jingyang under the Sui, a scholar known across Shandong, a master of the five classics and a fine calligrapher.
The boy grew up reading with his father and practising brushwork. The histories say he was quick, that he read widely in the classics and histories, and that his cursive and clerical script were both good.
At eighteen his prefecture recommended him for the imperial examination. He passed, was given a junior military title, and was later posted as a county lieutenant.
The examination system had only just been established under the Sui and took very few men. To pass at eighteen was early.
The vice minister of personnel, Gao Xiaoji, met him and said something to the chancellor Pei Ju that the Old History of the Tang wrote down. I have looked at a great many men, he said, and I have never seen a young man like this one. He will certainly become a great vessel. My only regret is that I will not live to see him rise into the sky.
Gao Xiaoji had a good eye. Among the other young men he had looked at was one called Du Ruhui, and he had said something similar about him.
Those two later became the planner and the decider at the right hand of Emperor Taizong.
Fang Xuanling did not stay long at his county post.
His father had taught him things he kept. He also said something to his father that he kept.
The Sui was still standing then and the realm had not yet broken. He said to his father privately: the emperor has no real achievement behind him. He took the throne only because he was related to the Northern Zhou house. He makes no long term plan for his descendants, he does not distinguish between wife and concubine, and everyone competes in extravagance. I think the disaster of the Sui is right in front of us.
He was in his early twenties.
A dozen years later the Sui was gone.
While Others Took the Jewels
In 617 Li Yuan raised his banner at Jinyang and crossed the Yellow River into the passes.
Fang Xuanling was north of the Wei River. He rode alone to the gate of Li Shimin camp and asked to be received.
The Old History of the Tang describes the meeting in six characters. Taizong saw him once and it was like an old friend.
He was given a post as secretary on the staff of the Wei River command, a clerk of documents.
He held that kind of post for more than ten years.
When an army took a city, other men went in for gold, silver, horses and women. Fang Xuanling did not.
He went looking for people.
Which county magistrate was capable. Which general had a strategist on his staff. Which local family had a son who could actually run something. He wrote the names down, went to see each one, and brought them into the household of the Prince of Qin.
Zhang Liang came through him. Du Ruhui came through him. Xue Shou and Li Daliang came through him.
Half of the men he gathered ended as chancellors and the other half as generals.
When Li Shimin was in the field, every memorial, order and proclamation that left the camp came from Fang Xuanling. The histories say he could stop his horse and finish a document on the spot, with few words, full meaning, and no need for a second draft.
Du Ruhui has his own story here.
In those years the crown prince and the Prince of Qin fought each other for talent. Li Jiancheng had Du Ruhui transferred out of the Qin household and sent to a post in another province. Fang Xuanling went to Li Shimin and said: every man in this household can go and it would not matter, but Du Ruhui cannot go. He is sharp, he sees the whole board, and he is the material of a king maker.
Li Shimin sent up a memorial that same day and kept him.
In 621 the prince set up a literary academy and gathered eighteen scholars. Fang Xuanling was one of them.
Every ambitious young man in the empire wanted into that building. Those who got in had a phrase for it. They said they had climbed to Yingzhou, the island of the immortals.
Two Daoist Robes
Once the Tang was founded, the crown prince was Li Jiancheng. The Prince of Qin had won too many battles, and the arithmetic between the brothers got uglier every year.
In 626 Li Jiancheng spoke against Fang Xuanling and Du Ruhui to their father. The emperor ordered both men out of the Qin household and forbade private meetings with the prince.
It was a clean cut at the nerve. Take away the brain and the body stops.
A few months later the thing could no longer be postponed.
On the first day of the sixth month, Venus appeared in daylight. The court astronomer Fu Yi sent a secret memorial: Venus is in the Qin quadrant, and the Prince of Qin should hold the empire.
The emperor showed the memorial to Li Shimin.
That night Li Shimin sent up a counter memorial accusing his brothers of misconduct in the inner palace. The emperor said: tomorrow at court, the three of you will confront each other face to face.
On the night of the third, two men in Daoist robes went into the house of the Prince of Qin.
Before dawn on the fourth, Li Shimin placed men inside the Xuanwu Gate.
Li Jiancheng and Li Yuanji rode in. At the Linhu Hall they sensed something wrong and turned their horses.
Li Shimin called out to them. An arrow left the string, and the crown prince was dead where he fell.
Yuchi Jingde arrived with seventy riders and killed Li Yuanji.
Three hours later the palace was settled.
Two months later the emperor abdicated. Li Shimin became emperor.
When the merits were counted, five men were placed first: Fang Xuanling, Du Ruhui, Zhangsun Wuji, Yuchi Jingde and Hou Junji.
The Books of an Empire
In 627 Fang Xuanling became chief of the secretariat. In 629 he moved to the head of the department of state affairs and became chancellor in practice.
He held that office for nearly twenty years.
In the Tang, chancellor was not one job title but a set of them.
The secretariat drafted edicts. The chancellery checked them. The department of state affairs carried them out, through six ministries covering personnel, revenue, rites, war, justice and public works. The heads of the three departments were all chancellors, and they met together in one room to decide.
The head of the secretariat ran the drafting. The head of the department of state affairs ran everything else, because every order in the empire passed through his hands.
Fang Xuanling did both in turn. He knew how the machine worked better than any man alive.
The daily business of a state comes down to four things on paper. How many officials there are. Where the money comes from. How a case is judged. How the history is written.
He handled all four.
The first was the officials. The Sui had left a swollen bureaucracy, with more than two thousand posts at the centre. He merged and cut until the number stood at six hundred and forty three. That figure went into the record of the Zhenguan reign and became a footnote to the whole era.
The second was the law. With Zhangsun Wuji and others he revised the code, cutting away most of the savage penalties of the Sui. A death sentence had to be reported and reviewed three times, and later five, before it could be carried out. That code became the base of the Tang legal commentary and stayed in use into the Song and Yuan.
The third was history. He supervised the court diaries of two reigns and led the compilation of the history of the Jin. Rewriting the past was also a way of settling the present, and he knew it.
The fourth was people. In twenty years the men he recommended filled dozens of senior posts. The histories say that when he heard of another man ability it pleased him as if it were his own.
The partnership with Du Ruhui produced a four character phrase that is still used. Fang plans, Du decides.
Du Ruhui died in 630 at forty six. For the next eighteen years Fang Xuanling carried it alone.
In 643 the emperor hung portraits of twenty four founding servants in the Lingyan Pavilion. Fang Xuanling was fifth, after Zhangsun Wuji, Li Xiaogong, Du Ruhui and Wei Zheng.
He was sixty five that year and still well. The painter came to the house, and he sat for it without ever smiling.
The strange thing is that a man who ran the government of an empire for twenty years could not manage one room in his own house.
A Tang notebook called Conversations of the Sui and Tang tells a story. The emperor gave him several beautiful women as a gift, and his wife, Lady Lu, refused to accept them. The emperor summoned her, offered her a cup and said: if you will not have them, drink this poison. She took the cup and drank it in one go. Only afterwards did she learn that it was vinegar.
Whether or not it happened, the Chinese word for jealousy, the phrase for drinking vinegar, comes from that story.

A Screen of Family Rules
In his last years Fang Xuanling did one thing at home.
He collected the family instructions of earlier ages, copied them out line by line, and had them written on folding screens. Each of his sons got one, to keep in his own room.
He told them: read these, and they are enough to keep you safe and to keep your name.
A man who had run a state for twenty years had screens to leave his sons.
In 648 he fell ill.
When he could no longer get out of bed, he still sent up a memorial against the emperor campaign in the northeast against Goguryeo.
Those campaigns had cost heavily. In the memorial he wrote: your majesty has shown enough of the martial side. The people are tired. Please stop.
The emperor read it and said to his daughter, Princess Gaoyang: the man is this ill and he is still worrying about my realm.
In the seventh month of that year Fang Xuanling died at seventy.
The emperor suspended court for three days, granted him the posthumous title of grand commandant, gave him the name Wenzhao, and had him buried at the Zhaoling imperial tomb.
At the time of his death none of his sons held high office.
Five years later, in 653, the second son, Fang Yiai, brought the family down.
Fang Yiai was married to Princess Gaoyang, a daughter of Taizong. The princess was arrogant, wanted the family title moved to her own husband, and quarrelled with the elder brother until the case reached the new emperor, Gaozong.
Gaozong handed the inquiry to Zhangsun Wuji. Digging into the quarrel, the investigators turned up meetings between Fang Yiai and a group of idle princes, and words that should never have been spoken.
A treason case came out of it. Fang Yiai was executed. Princess Gaoyang was ordered to kill herself. The elder brother was demoted, and the sons of the family were sent into exile in the far south.
Fang Xuanling lost his place among the honoured dead in the temple of Taizong.
The grave is still there at Zhaoling, in Liquan county in Shaanxi. The stone is tall and the carving can still be read.
Of the more than one hundred and eighty tombs grouped around that mountain, his sits in the nearer ring.
For twenty two years he kept the books of the empire. How many officials, how much money, how many articles of law, how many volumes of history.
Five years after he died, the books were void.
One thing survived.
The code. Every harsh clause he cut from the Sui statutes stayed on paper, and later dynasties amended it rather than replaced it.
A man who never took anything from a captured city left behind a stack of paper.