A new smoothing method for data processing in X-ray fluorescence spectroscopy using B-splines is presented. The effects of fitting with B-splines are studied in detail by computer simulations. Based on the simulated results we put forward a practical smoothing procedure which includes the adoption of AKAIKE's Information Criterion (AIC) as a criterion for fitting. It is shown that smoother results with less deformation are obtained by this method. Some remaining problems are also discussed.