Resonance-enhanced x-rays in thin films: a structure probe for membranes and surface layers