Preserve order of children when write()