X-ray absorption spectroscopy of polyureas and polyurethanes and their use in characterizing chemical gradients in thin-walled polyurea capsules