public static void writeField(@NotNull Element parent, @NotNull @NonNls String fieldName, @Nullable String value) {
    Element element = new Element(Constants.OPTION);
    element.setAttribute(Constants.NAME, fieldName);
    element.setAttribute(Constants.VALUE, value == null ? "" : value);
    parent.addContent(element);
  }
public static void writeField(@NotNull Element parent, @NotNull @NonNls String fieldName, @Nullable String value)