We demonstrate a flexible method for preparing hollow TiO2 nanospheres with movable silica nanoparticles inside (HTNMSNs). In this method, we used monodisperse silica--polystyrene core--shell nanospheres (SiO2-PS-CSNs) sulfonated as templates and prepared the composite shell consisting of TiO2 and sulfonated polystyrene (SPS) through adsorbing or depositing tetrabutyl titanate gel into the SPS shell. Finally the HTNMSNs were obtained after removal of all polymers in the composite nanospheres by dissolution or calcinations. We investigated the dependence of the morphologies of HTNMSNs on the thickness of PS shells and the size of SiO2 cores and prepared rare earth doped HTNMSNs by a sol-gel process.