Yea, very questionable topic....but, yea, it's been done before (Note: rooted WP8 devices, AKA Samsung only)...
I understand what the OP wants to do, he wants to install a app to his phone, then create a XAP from the app that is installed on his phone.
This only promotes piracy of applications and should be closed.