How to apply things to children?

I have this bit of code

other.gameObject.layer = 8;

That changes “other” to layer 8. Now how would i make it change the children of “other”?

AFAIK, you would have to loop through all the children

function ChangeLayer(go : GameObject, lr : int)
{
    go.layer = lr;
    for(ch : Transform in go)
    {
         ChangeLayer(ch,lr);
    }
}