DC XLPE cables have many advantages and are widely used in power transmission. The problem of space charge accumulation in DC cables has become the focus of attention. There is a lack of research on the charge distribution in XLPE under different working conditions. In this paper, the space charge distribution in the XLPE under aging, temperature gradient, and the presence of bubble defects is studied and simulated in COMSOL software based on the ambipolar carrier transport model. The research results show that the average charge density increases by 2.2% and 6.23% after electro-thermal aging for ten days and 30 days, which is close to the test results in the literature. When there is a temperature gradient in XLPE, the charge density on the side with higher temperature is more significant than that on the side with lower temperature, and the higher the temperature, the greater the mobility, resulting in deeper charge injection depth. When there is a bubble defect, a "recessed area" of charges is formed in the bubble, the charge density in the bubble is lower than that of the surrounding XLPE, and the charge accumulation at the interface between the bubble and XLPE is evident. The research results will provide a specific basis for the safe operation of DC XLPE cables.