It seems to be the typical planet orbit problem

Lets say, the sun is the middle of your universe... so it's at 0,0,0

rotating the sun would be

clear worldmatrix
rotate worldmatrix // turn sun
draw sun

to let the earth turn around the sun it would be

clear the worldmatrix
translate worldmatrix // move earth to its distance from the sun
rotate worldmatrix // rotate the world around the sun
draw earth

letting the earth turn on it's own axis would be
clear the worldmatrix
rotate worldmatrix // rotate earth around its axis
translate worldmatrix // move world in position
draw earth

letting the earth turn around the sun, while its turning around its own axis would be
clear the worldmatrix
rotate worldmatrix // rotate world around its axis
translate worldmatrix // move it to distance
rotate worldmatrix // turn it around sun
draw earth


Now, if the sun is not at 0,0,0 but at 40,0,0

then according to the last step it would be
clear the worldmatrix
rotate worldmatrix // rotate world around its axis
translate worldmatrix // move it to distance
rotate worldmatrix // turn it around sun
translate worldmatrix(40,0,0) // move it to the sun
draw earth

It's all just a matter of the order in which you manipulate the worldmatrix.

Hope I understood your question right