I found that the only reliable way to restore a stock ROM on this phone is SEUS.
SEUS stands for Sony Ericsson Update Service:
Update your phone for optimal performance and get the latest enhancements. Regardless if you have the latest software, it is a good routine to run Update Service to improve software stability. Also, if you experience problems with your phone this may be solved by a software update.
In the real world this piece of software can be used to restore the stock ROM. It takes care to download everything you need from Sony servers.
It’s a Windows software that was easily accessible from sony site, but now it’s quite hidden in their pages.
The official page is accessible from here.
The direct url I found to download the software is this.
I hope it’s useful to you as it was to me.