You can measure the XRR spectrum of the film and find out the critical angle for your film (Critical angle: Angle at which reflected intensity becomes 50% of the incident intensity).
Critical angle is related to the real part of refractive index of material, which in turn is related to density of the material:
critical angle=sqrt(2*delta)
Here, delta=1-n, n=real part of refractive index.
Delta obtained from XRR can be compared with the bulk values tabulated in CXRO database for ZnO.
So, now you have:
Delta from XRR
Delta from CXRO (referred to as bulk)
Density from CXRO (bulk)
You can find out the density of your film from proportionality of delta and density as:
Density of film=(Delta from XRR/Delta from CXRO)*Density from CXRO.
Now you know the mass density of your film, you can easily find the elctron density using atomic number, mass and Avagadro no.:
the critical angle mentioned above is the critical angle of total reflection. The relation between the critical angle and the optical constant delta is a consequence of Snells law of refraction for the case of total reflection (refracted beam is parallel to the sample surface).
Unfortunately the critical angle is in general not equal to the angular value at which the angular dependence of the reflectivity is 50%, as mentioned above.
In order to have access to delta you have to fit the angular dependence of the reflectivity with respect to delta and beta (beta is the imaginary part of the refractive index and bears the x-ray attenuation).
Please go through the papers of Parratt and Henke and pick up the appropriate formulae.
You will find the relation of delta and the density at equation 12 of the Parratt paper (normal dispersion expression)
L. G. Parratt; Surface Studies of Solids by Total Reflection of X-Rays;
Phys. Rev. 95 (2), pp. 359-369 (1954)
B. L. Henke; Ultra-soft x-ray reflection, refraction, and production of photoelectrons (100-1000-eV region);
Phys. Rev. A6 (No. 1); pp. 94 - 104 (1972).
I will send you these papers via RG messenger.
Appropriate software for XRR calculations and fitting: