if your system is debian based you can change only the package repositorys in the file
/etc/apt/source.list
if you want to change to debian squeeze you need to put:
deb
http://ftp.us.debian.org/debian/ squeeze main non-free contrib
deb-src
http://ftp.us.debian.org/debian/ squeeze main non-free contrib
deb
http://security.debian.org/ squeeze/updates main contrib non-free
deb-src
http://security.debian.org/ squeeze/updates main contrib non-free
(or you can googleit for the repositorys that you want)
after that you execute
"sudo apt-get update" (actulize package cache)
"sudo apt-get dist-upgrade" (distribution upgrade)
this re-install ALL the package you already have installed but from the new repository list.
afther that you need to knock who package are you missed, and start to install. lets supoose you want to change from Ubuntu to Xubuntu ; Ubuntu and Xubuntu have the same repositoris (so you dont need to change soruce.list in other words is the same distro with other flavor) but no the same default instalations package (Ubuntu install gnome-dektop) and (XUbuntu install xfce-desktop), so you need to run "apt-get install xfce" or install the metapackage "xubuntu-desktop" or something like that (Iam runing Debian so I can't check that, jeje)
Ahhh!! some thing: when you rewrite the source.list lots and lotssss of package well be BROKEN, so lot of hard work need to be done. And meabe (just meabe) your system can stop booting... so have a knoppix or some other rescue-cd is a good idea!
If you want Upgrade a ubuntu distro: ubuntu already have a program that make this AUTOMATIC and with GUI enviroment (but some times it broke something and problems are inevitable)