void (@NotNull Element indentOptionsElement, @Nullable IndentOptions defaultOptions) { SerializationFilter filter = null; if (defaultOptions != null) { //noinspection deprecation filter = new SkipDefaultValuesSerializationFilters() { @Override protected void configure(@NotNull Object o) { if (o instanceof IndentOptions) { ((IndentOptions)o).copyFrom(defaultOptions); } } }; } XmlSerializer.serializeObjectInto(this, indentOptionsElement, filter); }