/** Sets the value of the attribute */
  public void setValue(Object bean, QName name, Object value) throws ConfigException {
    try {
      if (value instanceof XmlBeanConfig<?>) {
        XmlBeanConfig<?> config = (XmlBeanConfig<?>) value;

        value = config.toObject();
      } else if (value instanceof AnnotationConfig) {
        AnnotationConfig config = (AnnotationConfig) value;

        value = config.replace();
      }

      if (_setMethod != null && value != null) {
        if (!_setMethod.getParameterTypes()[0].isAssignableFrom(value.getClass()))
          throw new ConfigException(
              L.l(
                  "'{0}.{1}' is not assignable from {2}",
                  _setMethod.getDeclaringClass().getSimpleName(), _setMethod.getName(), value));

        _setMethod.invoke(bean, value);
      }
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
  }