X-ray absorption spectroscopy of vanadium dioxide thin films across the phase-transition boundary