Are you going to switch host / server as well? If you are just changing your domain, it is relatively easy, assuming your host allows you to change your main domain. If not, you will ask their support to do it for you.
What are you trying to do exactly? If you want the domain to redirect to your site you can either park it or set up addon domain and create a .htaccess in that folder that redirects to your main domain.
Are you hosting multiple sites on same account? If not, then I would just ask your host to change your main domain to domain2.com, then park domain1.com and set up a redirect for that. That way you don't have to move your files.
If that isn't viable for you, just move your xF install to the folder the addon domain is pointing to and follow Slavik's instructions.