code: def _create_attr(self, property_key, data, ancestors):
          if not isinstance(property_key, six.string_types):
              raise TypeError("property_key must be a string. type: {0} was passed.".format(type(property_key)))
          if not isinstance(ancestors, OrderedDict):
              raise TypeError("ancestors must be an OrderedDict. type: {0} was passed.".format(type(ancestors)))
          previous_element        = self
          normalized_key          = normalize_value(property_key).replace('-', '_')
          normalized_ancestor_key = None
          if ancestors:
              for ancestor_key, ancestors_value in six.iteritems(ancestors):
                  normalized_ancestor_key = normalize_value(ancestor_key).replace('-', '_')
                  if normalized_ancestor_key.lower() == 'root':
                      continue
                  if not hasattr(previous_element, normalized_ancestor_key):
                      config_attr       = ConfigDict({}, ancestors_value.start_mark, ancestors_value.end_mark)
                      config_attr.name  = normalized_ancestor_key
                      config_attr.alias = ancestor_key
                      setattr(
                          previous_element,
                          normalized_ancestor_key,
                          config_attr
                      )
                  previous_element = getattr(previous_element, normalized_ancestor_key)
          if normalized_key == normalized_ancestor_key:
              pass
          else:
              if isinstance(data, ConfigNode):
                  data.name  = normalized_key
                  data.alias = property_key
              setattr(previous_element, normalized_key, data)