This paper takes a portion of the Manas River Basin in Xinjiang Province, China, as an example and proposes an improved traditional comprehensive water quality index (WQI) method using Extreme Gradient Boosting (XG-BOOST) to analyze the groundwater quality levels in the region. Additionally, XG-BOOST is used to screen the existing dataset of ten water quality indicators, including fluoride (F), chlorine (Cl), nitrate (NO), sulfate (SO), silver (Ag), aluminum (Al), iron (Fe), lead (Pb), selenium (Se), and zinc (Zn), from 246 monitoring points, in order to find the dataset that optimizes model training performance. The results show that, in the selected study area, water quality categorized as “GOOD” and “POOR” accounts for the majority, with “GOOD” covering 48.7% of the area and “POOR” covering 31.6%. Regions with water quality classified as “UNFIT” are mainly distributed in the central–eastern parts of the study area, located in parts of the Changji Hui Autonomous Prefecture. Comparatively, water quality in the western part of the study area is better than that in the eastern part, while areas with “EXCELLENT” water quality are primarily distributed in the southern parts of the study area. The optimal water quality indicator dataset consists of five indicators: Cl, NO, Pb, Se, and Zn, achieving an accuracy of 98%, RMSE = 0.1414, and R2 = 0.9081.