added #empty, override #toJSON to account for children nodes