Third attempt.. the method you suggested wouldn't work if $newName was `foobar`, it assumes that the given name is always prefixed with `/` right? I don't know if that is always the case or not.

I think this really should be in phpcr-utils though, it must get repeated in a few places.