code: public static void setAttribute(List<Attribute> attrs, String name, String v) {
          for (Attribute attr : attrs) {
              if (name.equals(attr.getAttributeName())) {
                  if (v!=null) attr.setAttributeValue(v);
                  else attrs.remove(attr);  // TODO this will throw a concurrent modification exception
                  return;
              }
          }
          if (v!=null) {
              Attribute attr = new Attribute(null, name, v);
              // TODO: need to retire attribute type concept
              attrs.add(attr);
          }
      }
docs: Set the value of a process attribute.
  If the value is null, the attribute is removed.
  If the attribute does not exist and the value is not null, the attribute
  is created.
  @param name attribute name
  @param v value to be set. When it is null, the attribute is removed