X-ray magnetic circular dichroism as a tool for magnetic studies of 4f compounds