welcome to the forum
I think it is very difficult. It depends to your application, how big it is and what components are used.
From my experience it is a good idea to move to EE5 or EE6. With this approach you will get rid of the XML by use annotations, have dependency injection.
This will shrink that code dramatic and make the business code more transparent and maintainable.
If you use XDoclet I think it will be difficult and you might have to adapt XDoclet because there is no maintenace at all.
Also if you have a spec conform application it will more easy to migrate.