Xunzi's pessimistic understanding of human nature and his endorsement of the intrinsically valuable virtue of yi 義 put him in a vulnerable position. To defend this position, Xunzi needs to conquer what the essay calls "the compatibility problems," the first of which concerns the compatibility between bad human nature and virtue, while the second is between Xunzi's functional understanding of virtue and his understanding of virtue as possessing intrinsic value. If Xunzi's moral philosophy were to fail to solve these two problems, it would be guilty of inconsistency. In reconstructing a genealogy of Xunzi's philosophy, I argue that he can successfully resolve the two compatibility problems, and his genealogy perspicuously shows that virtue can grow out of vicious human nature.