Image copyright AP

The UK says it wants to be China's best friend in the West, and will be laying out the red carpet for the country's new strongman, President Xi Jinping, when he begins a state visit on Monday. But what kind of person is he? I tried to find out by visiting the cave where he lived for seven years in his youth.

I was looking forward to seeing the cave where China's president grew up but as our van skimmed along behind the sleek black sedan, I was nervous too. The man from the propaganda department already had an anxious sheen about him. I foresaw trouble.

President Xi is building a personality cult. The last thing the strongman with the perfect creation myth needs is the BBC puncturing it. So pity that local propaganda chief in the car ahead.

In general the president's spin doctors do a very slick job of presenting him as a man of the people. He tours leaky back alley homes, ducking through washing lines and wearing no face mask - the message that this is a leader prepared to breathe the same polluted air as you. He talks to his public in earthy prose, telling students that life is like a shirt with buttons where you have to get the first few right or the rest will all go wrong. He queues up in an ordinary dumpling shop for lunch and pays for his own meal. Message - he is neither greedy nor showy.

Image copyright Getty Images

It's all clever political signalling of course. Behind the smile, Xi Jinping is a ruthless operator. You don't rise to the top of the Chinese communist party without being a consummate political player and Mr Xi has spent a lifetime playing.

But the Sedan in front was now stopping at a police barrier. We'd arrived at the heart of the president's creation myth. Nearly five decades ago, the 15-year-old Xi fled from the chaos of the capital to this bleak and breathtaking landscape of yellow canyons, caves and mountains. The contrast with life in Beijing must have been even more extreme in those days.

Find out more Listen to From Our Own Correspondent for insight and analysis from BBC journalists, correspondents and writers from around the world Broadcast on Radio 4 on Thursdays at 11:00 and Saturdays at 11:30 and on BBC World Service Listen to the programme Download the programme

Especially for Xi himself. He had actually lived two lives by the age of 15. In the first his father was a hero of the communist revolution so Xi spent his early years as a so called red princeling, enjoying a privileged upbringing. But all of that was shattered by the civil war that an increasingly paranoid and vengeful Chairman Mao inflicted on the party elite in the 1960s. Xi's father was jailed, his family humiliated. One of his sisters died. Without parents or friends to protect him from the murderous red guards dispensing summary justice on the streets, the teenage Xi lived his second Beijing life, dodging death threats and detention… until he came to this village.

Millions of Chinese city kids were doing the same thing. Chairman Mao had decreed they should spend time in the countryside, learning from the hard life of the peasants, and Xi Jinping says he did learn. The spin doctors have turned his teenage trauma into triumph. This village has become a shrine to its most famous son, a vital part of the president's image. I left my heart in Liangjiahe. Liangjiahe made me, he likes to claim.

Image caption Liangjiahe, with all of its canyons and caves

There aren't many 21st Century leaders of whom you can say that they lived in a cave and made it as a farmer before clawing their way to the political summit. But in control-conscious China, those facts could not possibly be allowed to speak for themselves. So I was marched round a museum extolling the good deeds that Xi did for his fellow villagers, and whenever my attention flagged a gushing guide stepped forward to fill in narrative gaps, and I soon realised that what I'd mistaken for phalanxes of communist party pilgrims were actually propaganda officials. Also keeping an eye on me rather than the museum exhibits, a liberal sprinkling of plainclothes police.

Image caption The police and propaganda team watch on

Why the paranoia? Why does the history have to be sanitised, all trace of real personality expunged? I wasn't looking for revelations of youthful depravity or character flaws. But everywhere I turned the memories were so carefully crafted it was hard to work out whether any of them were real. And all the while, the propaganda chief's glassy pallor worsened. Eventually he asked me to sign a document promising that every word the BBC said about President Xi would be positive. He blanched when I said I couldn't. It might be his job to burnish the presidential image, but it certainly wasn't mine.

The great irony of Xi Jinping's personality cult is that under Chairman Mao he and his family suffered from strongman politics. And after the tragedy of the cultural revolution the communist party resolved it would never make the same mistake again. Grey faceless committees ran China for the next 40 years. But now the strongman is back. And perhaps also the danger that those who forget history are doomed to repeat it.

For us it was time to leave the caves. The propaganda chief had started threatening to confiscate our recordings. President Xi may have left his heart in Liangjiahe but I didn't want to leave all the material I'd gathered there. That night we made a sudden bolt, driving 200 miles (320km) to an airport from which we could get our work out of China. Strange exploits when you consider that the cave years are possibly the most positive chapter of Xi Jinping's life even without persuasion and threats from the propaganda department.

Mao's Cultural Revolution

Image copyright AFP

In May 1966, Chairman Mao launched the Cultural Revolution

The 10-year political and ideological campaign was aimed at reviving revolutionary spirit and purging the country of "impure" elements

Young Chinese people were sent to the countryside to learn from the hard life of the peasants

Millions of people were persecuted and killed during Mao's rule

BBC History

How to listen to From Our Own Correspondent:

BBC Radio 4: Thursdays at 11:00 and Saturdays at 11:30

Listen online or download the podcast.

BBC World Service: At weekends - see World Service programme schedule or listen online.

You can watch Carrie Gracie's film for Panorama, The Xi Factor, on BBC1 on Monday at 20.30

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.