You can set environment variables in XP via Control Panel -> System. Then choose the "Advanced" tab and there is a button at the bottom to set environment variables. You can set either user variables or system variables. I believe they get stored in the registry and get read as XP loads.
Is that what you're after? If not, what are you trying to achieve?