The geometry of a Si3N4 lamellar grating was investigated experimentally with reference-free grazing-incidence X-ray fluorescence analysis. While simple layered systems are usually treated with the matrix formalism to determine the X-ray standing-wave field, this approach fails for laterally structured surfaces. Maxwell solvers based on finite elements are often used to model electrical field strengths for any 2D or 3D structures in the optical spectral range. We show that this approach can also be applied in the field of X-rays. The electrical field distribution obtained with the Maxwell solver can subsequently be used to calculate the fluorescence intensities in full analogy to the X-ray standing-wave field obtained by the matrix formalism. Only the effective 1D integration for the layer system has to be replaced by a 2D integration of the finite elements, taking into account the local excitation conditions. We will show that this approach is capable of reconstructing the geometric line shape of a structured surface with high elemental sensitivity. This combination of GIXRF and finite-element simulations paves the way for a versatile characterization of nanoscale-structured surfaces.