There are a few areas in Yunnan province that call themselves "the real Shangri-la" in an attempt to lure Western tourists. But the place that is perhaps most like James Hilton's mythical valley has shown little interest in rebranding itself - no doubt because its story is already so compelling.

Shaxi is a sun-soaked valley high in the Himalayan foothills of northwest Yunnan whose welcoming Bai people, like those in Hilton's Lost Horizon, work verdant fields until the end of their long lives. Surrounded by mountains halfway between the tourist cities of Lijiang and Dali, Shaxi's inaccessibility has kept away the tour groups - but a new highway will soon change that.

Before modern roads, Shaxi was an important stop on the Tea Horse trade route and in the valley remains its last intact market town. Predating the Silk Road, the Tea Horse caravans carried Tibetans, who traded horses and animal furs for tea, salt and medicines, through Yunnan into Myanmar.

Shaxi continues the tradition of a Friday market, where the Bai trade everything from household goods and farm tools with the Yi and Yao people of the surrounding mountains, who bring exotic mushrooms, wild rhododendron honey and meat.

The cobblestone footpaths, rammed earth courtyard houses and emerald fields give Shaxi a bucolic charm that requires no commercial gimmicks.

Sixteen villages dot the Shaxi valley. Each is known for a particular craft or tradition and has a unique folk temple. One temple may feature the God of Culture, Kuixing, encouraging students to do well in school; another might centre on a local god that protects its village or promotes prosperity. Until recently, the largest of these temples, a former nunnery in the village of Diantou, was a neglected ruin. Its transformation can be credited to two baby girls; sisters who were destined never to meet.

MY WIFE, NAM, and I first came to Ci Yin An, the Temple of Hidden Compassion, in 2011, after the loss of our daughter 18 months earlier. She was our only child and since her passing my wife had been unable to conceive. We had been invited by an intrepid travel writer friend who knew that in my 20 years in China, I had never stopped looking for unspoiled places to visit - and Shaxi was exactly that.

When we entered the temple, dried juniper was burning in a censer but there was no sign of people. The eaves sagged, water leaked through the roofs and a thick carpet of moss covered the courtyards.

As we entered the main hall, Nam, who is Thai and a Buddhist, recognised a statue of Songzi Guanyin, the Goddess of Compassion Who Brings Children. Incense was scattered on the altar so Nam lit some and silently prayed while I tried to read the inscriptions on a dusty stone tablet in the wall. Guanyin shared the hall with shrines to the guardian god Yama, his consort, Yami, and Bodhidharma, the patriarch of Chinese Buddhism. On each side of the hall were paintings of the 18 Arhats performing feats of spiritual magic.

There was much more to this temple: a hall dedicated to Caishen, the God of Wealth, another to the Shakyamuni Buddha and, up some steep narrow stairs at the very top, one to Yuhuang, the Taoist Jade Emperor and monarch of all deities in heaven. There were many empty rooms, some where the roof had fallen in or been dismantled for firewood during the Cultural Revolution and never restored. There was a ghostly feel to the place; amid the ruins were signs of worship everywhere, but there was no one to be seen.

A month after having returned to our home in Chiang Mai, Nam became pregnant. At first I made no connection between this and the temple, but eight months later, after the birth of our second daughter, my wife urged me to return to Ci Yin An and "pay it forward".

Two months later I returned to Shaxi and sought out the village elders in charge of the temple to propose we create a basic restoration plan. The town government had their own idea, which was that I take stewardship of the temple and use some of the empty rooms for something other than the current mahjong club. We proposed to strictly maintain the shrines and altars while installing a visitor centre, a gallery, a teahouse, a meditation centre and classrooms, to which the government and elders enthusiastically agreed. It was much more than Nam originally had in mind, but we were both committed.

We started work at the end of March 2011, taking advantage of dry weather to remove every roof of the 900 square metre complex, replacing all the rafters and rotten beams. We then reset the original tiles, having individually cleaned them of moss and lichen. The next stage involved excavating building walkways and hall floors down to the original foundations, installing pavers and replacing second-storey wooden floors. Next came new stonework around the tree planters, balustrades and thresholds, and finally lighting and a water supply.

"Not since the era of the Guangxu [Emperor]," beamed Elder Council Chief Luo, "has anyone done so much for this temple."

We gave the restored Ci Yin An the English name Pear Orchard Temple, as it is surrounded by old growth pear trees.

Shaxi carpenters are renowned throughout China and we were lucky to have a skilled team who instinctively understood Bai post and beam design, which relies on rammed earth walls and sophisticated joinery without the use of nails. This June, we completed all structural work and built furnishings from reclaimed wood.

The next phase will include the addition of stables for horses, to provide trekking to the Shibaoshan Buddhist grottoes in the nearby mountains, and micro-campus facilities for student groups.

Hopefully, Guanyin will be pleased with the final results.

For more information about the temple, a blog chronicling its restoration is at www.ginkgosociety.org The visitor centre website is www.shaxichina.com

Getting there: China Eastern Airlines flies from Hong Kong to Lijiang, via Kunming. From Lijiang, airport taxis take about 90 minutes to get to Shaxi. Alternatively, there are public buses from Lijiang to Jianchuan and from there to Shaxi, which takes about three hours.