code: public void replace(TLVElement childToBeReplaced, TLVElement newChild) {
          for (int i = 0; i < children.size(); i++) {
              if (children.get(i).equals(childToBeReplaced)) {
                  children.set(i, newChild);
                  return;
              }
          }
      }
docs: Replaces first element with given one.
  
  @param childToBeReplaced
  TLV element to be replaced.
  @param newChild
  new TLV element.