Xun Zi opposed many of Mencius' ideas, and built a structured system upon the idea that human beings were essentially badand had to be educated and exposed to the rites (li), before being able to express their goodness.Some of Xun Zi's disciples, such as Han Feizi, became Legalists (a kind of law-based totalitarianism, quite distant from virtue-based Confucianism) and helped Qin Shi Huang to unify China under the strong state control of every human activity.
The culmination of Confucius' dream of unification and peace in China can therefore be argued to have come from Legalism, a school of thought almost diametrically opposed to his reliance on rites and virtue.
The spread of Confucianism
Confucianism survived its suppression during the Qin Dynasty partly thanks to the discovery of a trove of Confucian classics hidden in the walls of a scholar's house. After the Qin, the new Han Dynasty approved of Confucian doctrine and sponsored Confucian scholars, eventually making Confucianism the official state philosophy (see Emperor Wu of Han). Study of the Confucian classics became the basis of the government examination system and the core of the educational curriculum. No serious attempt to replace Confucianism arose until the advent of communism in the 20th century.