Rotate a child object relative to another child object

I have an object called T which is the parent of an object called cT.
I also have an object called D which is the parent of an object called cD.

How can I rotate T so that cT has the same rotation in worlds space as cD?
Please note that relative rotation of cT to T must not alter, and that the relative rotation of cD to D must not alter.

Try this:

var q = Quaternion.FromToRotation(Tc.transform.forward, Dc.transform.forward);
T.transform.rotation = q * T.transform.rotation;

Works great. Thank you