A magnetoresistive sensor having a Ta cap layer with nitrogen added in
situ during deposition. The nitrogen in the cap layer can be formed by
depositing a Ta cap layer in a sputter deposition chamber having a small
amount of nitrogen in an Ar atmosphere. The resulting nitrogenated cap
layer exhibits reduced specular scattering, which results in improved
magnetic performance of the magnetoresistive sensor.