Changing the value of a variable wirelessly via Xbees

I'm trying to use the Serial.read function, but don't really know if there's an easier way.

Easier than what? Using the proper method?

You could ignore the XBee and just generate a random number. That would be easier.