For the analysis of solid samples, such as alloys, by means of XRF, one normally assumes that either the samples are completely homogeneous, or that heterogeneity effects can be neglected or cancelled out. The authors have studied this effect by means of Monte Carlo Simulations. Two particular geometries have been studied. For the first simulations the sample consisted of alternating lamellae of different composition, perpendicular to the irradiated surface. Later, the more realistic distribution of a spherical dispersed phase in a matrix was simulated.