One problem in multiuser multiple-input multiple-output (MU-MIMO) systems is that the transmitted signal from a base station to a user is interfered by the signals to other users. MU-MIMO precoding has been proposed as an effective way to solve the problem. However, most existing precoding methods are mainly designed with zero-forcing (ZF) or minimum mean-square-error (MMSE) criterion and the performance is not optimal. In this paper, we consider a precoding scheme for MU-MIMO systems where maximum-likelihood (ML) detection is used for each user. We propose using a newly developed X-structured precoder which is specifically optimized for the ML detection. In our method, multiuser interference is first mitigated by using a regularized block diagonalization (RBD) technique. Then, an iterative method is used to construct the X-structured precoder so that the performance of the ML detection can be enhanced. Numerical results show that the proposed method can significantly outperform existing precoding methods.