Writing and reading to the 24LC128

Hey, I'm having an issue with reading values from the EEPROM chip that I set up in I2C. It's meant to be getting readings from an accelerometer that's hooked up (the accelerometer works fine).
I'm sure that the values are getting stored correctly, since the oscilloscope is showing data transfer when I connect it up, but when I try to read the values back in decimal they all always come back as 255. Is there something wrong with the Wire.read section of my code, which would cause 'value' to always show as 255?
Sorry about how bad the coding may seem, but any help would be greatly appreciated. Thanks.

The full code that I used should be shown below.

#include <SPI.h>
#include <ADXL362.h>
#include <Wire.h>

#define memory 0x50 //address of the eeprom chip

ADXL362 xl;

byte address = 0;
byte XValue, YValue, ZValue;
byte value;
byte counter1;
#define led 13

void setup(){
pinMode(13,OUTPUT);
Serial.begin(9600);
Wire.begin();
xl.begin(10); // Setup SPI protocol, issue device soft reset
xl.beginMeasure(); // Switch ADXL362 to measure mode

Serial.println("Start Demo: Simple Read");

Wire.beginTransmission(address);
for (counter1 = 0; counter1 < 30; counter1++){
xl.readXYZ8Data(XValue, YValue, ZValue);
Serial.print("XVALUE=");
Serial.print(XValue);
Serial.print("\tYVALUE=");
Serial.print(YValue);
Serial.print("\tZVALUE=");
Serial.println(ZValue);

Wire.write((byte)(address, XValue));
address++;
Wire.write((byte)(address, YValue));
address++;
Wire.write((byte)(address, ZValue));

address = address + 1;
delay(100);
}
Wire.endTransmission();

Serial.println("Finished Writing");
digitalWrite(13,HIGH);

delay(5000);

Wire.beginTransmission(address);
for (counter1 = 0; counter1 < 90; counter1++){
byte value = Wire.read();
Serial.print(counter1);
Serial.print("\t");
Serial.println(value, DEC);
delay(10);
}
Wire.endTransmission();
while(1){
}
}

Wire.write((byte)(address, XValue));

What do you think you are casting here? Why are you casting anything?

That was the line that I had previously used to write the Xdata of the accelerometer to the address. It worked when I used it on the internal eeprom.

Your using the internal eeprom code as a template for the extenal eeprom has sent you in the wrong direction. You are not distinguishing properly the device address and the memory address, and your handling of the wire library is not correct in several ways. Your read needs to use Wire.requestFrom().

I would start with this example from the Arduino playground to show you some of the basic read/write functions.
http://playground.arduino.cc/Code/I2CEEPROM

I would also take a look at Nick Gammon's tutorial on i2c which has an example of writing to an external eeprom