If you reside outside Spain, you can apply for and obtain the NIE from the closest Spanish Consulate to your place of residence. With a power of attorney, your lawyer can also obtain on your behalf, in Spain, a tax number replacing the NIE.