def METHOD_NAME(self, node: Any) -> Optional[Any]:
    if isinstance(node, (YAMLRoot, dict)):
        if isinstance(node, YAMLRoot):
            node = self._add_type(node)
        for k, v in list(items(node)):
            if v:
                new_v = self.METHOD_NAME(v)
                if new_v is not None:
                    node[k] = new_v
    elif isinstance(node, list):
        for i in range(0, len(node)):
            new_v = self.METHOD_NAME(node[i])
            if new_v is not None:
                node[i] = new_v
    elif isinstance(node, set):
        for v in list(node):
            new_v = self.METHOD_NAME(v)
            if new_v is not None:
                node.remove(v)
                node.add(new_v)
    elif isinstance(node, ClassDefinitionName):
        return ClassDefinitionName(camelcase(node))
    elif isinstance(node, SlotDefinitionName):
        return SlotDefinitionName(underscore(node))
    elif isinstance(node, TypeDefinitionName):
        return TypeDefinitionName(underscore(node))
    elif isinstance(node, SubsetDefinitionName):
        return SubsetDefinitionName(underscore(node))
    elif isinstance(node, ElementName):
        return (
            ClassDefinitionName(camelcase(node))
            if node in self.schema.classes
            else SlotDefinitionName(underscore(node))
            if node in self.schema.slots
            else SubsetDefinitionName(camelcase(node))
            if node in self.schema.subsets
            else TypeDefinitionName(underscore(node))
            if node in self.schema.types
            else None
        )
    return None