LIANGJIAHE, China — Almost 50 years after Xi Jinping first trudged into this village as a cold, bewildered teenager, hundreds of political pilgrims retrace his footsteps every day.

They follow a well-trod course designed to show how the seven years that the young Mr. Xi spent in this hardscrabble village in China’s barren northwest forged the strongman style that he now uses to rule the world’s most populous nation. Visitors peer down a well that Mr. Xi helped to dig, admire a storage pit that he built to turn manure into methane gas for stoves and lamps, and sit for inspirational lectures outside the cave homes where he sheltered from the chaos of Mao Zedong’s Cultural Revolution.

“When he first arrived in Liangjiahe, he wasn’t prepared for the hardship,” a guide told a tour group of officials, who listened attentively under a drizzling rain. The message, conveyed by the guides and the village’s carefully tended buildings and artifacts, is that Mr. Xi left Liangjiahe steeled for the leadership roles that he would one day assume.

Turning a leader’s former home into a tableau for propagating his political-creation myth has a venerable precedent in the People’s Republic. Back in the 1960s, Mao’s birthplace, Shaoshan, was turned into a secular shrine for slogan-chanting Red Guards who looked on modern China’s founder as a nearly godlike figure.