code: public ModelNode fromChangeset(Map<String, Object> changeSet, ModelNode address, ModelNode... extraSteps)
      {
  
          ModelNode define = new ModelNode();
  
          ModelNode actualAddress = address.hasDefined(ADDRESS) ? address.get(ADDRESS) : address;
  
          define.get(ADDRESS).set(actualAddress);
  
          define.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
  
          ModelNode undefine = new ModelNode();
          undefine.get(ADDRESS).set(actualAddress);
          undefine.get(OP).set(UNDEFINE_ATTRIBUTE);
  
          ModelNode operation = new ModelNode();
          operation.get(OP).set(COMPOSITE);
          operation.get(ADDRESS).setEmptyList();
  
          List<ModelNode> steps = new ArrayList<ModelNode>();
  
          for(String key : changeSet.keySet())
          {
              Object value = changeSet.get(key);
  
              ModelNode step = null;
              if(value.equals(FormItem.VALUE_SEMANTICS.UNDEFINED))
              {
                  step = undefine.clone();
                  step.get(NAME).set(key);
              }
              else
              {
                  step = define.clone();
                  step.get(NAME).set(key);
  
                  // set value, including type conversion
                  ModelNode valueNode = step.get(VALUE);
                  setValue(valueNode, value);
              }
  
              steps.add(step);
          }
  
          // add extra steps
          steps.addAll(Arrays.asList(extraSteps));
  
          operation.get(STEPS).set(steps);
  
          return operation;
      }
docs: Turns a changeset into a composite write attribute operation.
  
  @param changeSet
  @param address the entity address
  @return composite operation