Element () { //provide new element if all State fields have their default values - > to delete existing settings in xml, return ObjectUtils.chooseNotNull(XmlSerializer.serialize(myState), EMPTY_ELEMENT); }