Murphy's law applies in China with a vengeance. Recently at least, almost everything that could have gone wrong has gone wrong.

The country is now undergoing simultaneous crises in economic policy, foreign policy and ideology. But I wind up a tour as one of the party accompanying Henry Kissinger on his visit here persuaded that the Chinese are facing their problems with formidable courage, and a determination not to make matters worse by a leadership struggle.

China's economic problem goes back to 1958. The Great Leap Forward, which was announced in that year, proved a flop. The Cultural Revolution of the mid-1960s was a step backward.

Now the modernization program, formally approved by the National People's Congress only a year ago, has stalled. Since 1958, in other words, China has been vainly seeking an avenue to rapid development.

In foreign affairs, the Chinese assert they fought well in the 16-day war against Vietnam. But so far at least, the Vietnamese have not learned the lesson the Chinese set out to teach them.

Vietnamese troops continue to occupy Cambodia. Hanoi's connection with Moscow has depended. There is talk of having to teach the Vietnamese a second lesson. But very cautious talk. For the Chinese know - and so do I after a visit to Urumchi in the remote Northwest of the country - just how exposed they are to Soviet military action.

For once, Peking is without a clear ideological guide as to how to cope. If there was a start toward democracy last December, it has been reversed. Maoism in modern form has been given a new lease on life through the reopening of the dead leader's mausoleum. It is typical of the confusion that one group of leaders - a group that once supported the Gang of Four against Vice Premier Deng Xiaoping and then lined up behind the premier and party chairman, Hua Guofeng - is known as the "whatever faction."

Amidst all this travail, however, the nation endures. What is happening now seems a mere moment in time set against the vast panorama of 24 dynasties and 6,000 years of continuous history unveiled for us at the ancient capital of Sian. Material difficulties seem to disappear under the magic of the Chinese imagination.

On a tour of a cave in Guelin, a lovely guide with a touch of Leslie Caron about her pointed out in what first looked like a blank wall the outlines of a hill overgrown with mushrooms."There is a legend about the hill," she said. "It is that an old man came to gather mushrooms. The more he gathered the more the mushrooms grew." Perhaps because of that imaginative faculty, the Chinese seem to shoulder troubles with grace. I have been here enough times, I think, not to be taken in by the sight of waving peasants or smiling workers. But the fact is that during nine days in five cities I have seen only child crying. Nowhere do I find the feeling of oppression and unhappiness that I sense almost everywhere in most of the Communist world.

The Chinese leadership, moreover, after years of chaotic infighting, seems aware of the costs of struggle at the top. Vice Premier Deng, at a dinner he gave for Dr. Kissinger, seemed to hold under tight rein his famous impulsiveness. He ended dinner by expressing the hope that "I don't make any mistakes." He confided at one point that he did not expect to make any further foreign trips. He seemed restrained, almost wisful - not the self-confident boss secure at the top of the greasy pole he so often climbed before.

Chairman Hua Guofeng, by contrast, showed no sign of the slashing cuts that he is supposedly receiving in the leadership struggle. He seemed relaxed confident and well-informed - the spokesman for a unified position.

Finally, there is the figure cut by Marshal Yeh Jianying - the revered former defense minister who is now president of the National people's Congress. We did not see him. But he published a poem in the People's Daily on April 26.

The theme was a visit to the house in Sian where, back in 1936, the Chinese communists used the kidnapping of the national leader Chiang Kai-shek to force a unified position against an external enemy. The tone of the poem was bleak, almost Lear-like. "The house is the same, but most of the people are dead," one line read.

But the message sustains a theory that Marshal Yeh is using his prestige to prevent an outbreak of warring factionalism. The unmistakable message in the poem was: "Hang in there."