[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] KristianKenneth:
Here is the tutorial for Installing stock 4.0.2.A.0.62 ROM plus root and CWM. I am not responsible or anyone mentioned below for bricking your phone in case, tested on my Xperia ray with unlocked bootloader using S1 tool.

Requirements

Unlocked Bootloader (preferred) although there is a work around for locked bootloader

4.0.2.A.0.62 FTF files

Flashtool

recoveryRay.img by and Rootxperia.zip b1n4ry (for rooting)

CWM

Installation:

How to Install stock 4.0.2.A.0.62 ROM:

Download this stock 4.0.2.A.0.62 ROM. Thank you Aire for providing the link.

After download you will have a zip file. Extract it.

Download flashtool here and extract it.

Create FTF file using flashtool from the 4.0.2.A.0.62 ROM zip you extracted earlier. Now if you don't know how to create FTF files, there's a good tutorial here.

If you successfully created FTF file, you should see a file with extension “.ftf” in the “firmwares” folder inside “FlashTool” folder

Run the executable “X10FlashTool.exe” located in the FlashTool folder

Now click “Flash” button and select flashboot. Now select the firmware from the popup menu. Make sure “Wipe user data” box is checked and then click “OK”.

The application will ask you to put your Ray in flashboot mode, to do this turn off the phone, hold the volume down button while while connecting the USB cable to your computer.

Follow the on screen instruction and your device will reboot. Notice that the reboot process will take longer at first.

How to install Root

Please note that this is only applied to devices with unlocked bootloader. Alternately, you can just install a custom kernel and root using zergrush method but if you want to try the .62 kernel from this stock rom then do this.

Download rootxperia.zip here and place it in your sd card

Enter device in fastboot mode. Turn off phone, hold volume up while you connect the USB cable to computer

Download the recoverRAY.img provided below, you will get a zip file, extract it.

Open folder inside Flashtool where fastboot.exe exists (/FlashTool/x10flasher_lib)

Place the recoveryRAy.img inside the folder

Open command line in this folder

Test if it recognize your device, to do this type fastboot devices, if there is a result here proceed.

Now here's the tricky part, to enter a temporary recovery type fastboot boot recoveryRAY.img

*Notice that we didn't use fastboot flash boot ****.img here because as bin4ry said this recovery is designed to work just as recovery, if you flash it to your device it will NOT boot system anymore! This is just a temporary recovery for you so be careful not to flash it.

Now wait and your phone will reboot, you will see the FREE XPERIA splash screen and your device will now enter temp CWM recovery

On your phone choose install custom zip, locate the rootxperia.zip you added earlier in your SD card and flash it.

Reboot, your device is now rooted.

*to root your device with locked bootloader, they say you can install previous stock kernel and root using zergrush method.

How to install CWM

Download this then extract

Make sure you enabled USB debugging, and also you need to set Screen timeout to 10 minutes so you don't miss the superuser promt

Run install-cwm1.cmd from the folder

Follow screen on screen instruction, reboot.