I assume your phone is X10i (if it's X10a let me know)
1.- download stock generic firmware http://minus.com/mAla782XK/1f
2.- download and install flashtool http://androxyde.github.com/Flashtool/
3.- inside flashtool you'll find several folders, unrar your firmware (X10i_3.0.1.G.0.75_1241-1846.ftf ) inside firmware folder, do not connect your phone yet
4.- run flashtool and click on "flash" icon, pick flashmode, then OK
5.- On the left side select your firmware and hit OK (It will say "preparing files for flashing")
6.- A window giving you instruccions will pop up, just press and hold the back button on your phone, connect the USB cable (which is already connected to PC, of course ) and don't let go the button until you read flashtool started to flash
7.- wait 'till it finishes
8.- It will only take a few minutes, the only moment it seems it's stucked is when is flashing "system" , don't worry, it takes a little longer that the other files.
9.- after is done, just unplug, turn it on and wait, don't forget first boot always takes a little longer too!!!!!!
10.- If you want to, use flashtool to root your phone and install xrecovery afterwards, that's it, brand new
Hope it helps and is clear enough, any question just ask, I'm usually here.
Don't forget to hit "thanks" if I was helpful!!
Sent from my Xperia X10[LB, Doom Kernel with Ferav19] using xda premium