use self.class instead of constant name to allow inheritance
update the root node when setting a nested attribute