docs: public void updateByXml(Source source) throws IOException {
          checkPermission(CONFIGURE);
          StringWriter out = new StringWriter();
          try {
              // this allows us to use UTF-8 for storing data,
              // plus it checks any well-formedness issue in the submitted
              // data
              XMLUtils.safeTransform(source, new StreamResult(out));
              out.close();
          } catch (TransformerException|SAXException e) {
              throw new IOException("Failed to persist configuration.xml", e);
          }
  
          // try to reflect the changes by reloading
          try (InputStream in = new BufferedInputStream(new ByteArrayInputStream(out.toString().getBytes(StandardCharsets.UTF_8)))){
              // Do not allow overwriting view name as it might collide with another
              // view in same ViewGroup and might not satisfy Jenkins.checkGoodName.
              String oldname = name;
              ViewGroup oldOwner = owner; // oddly, this field is not transient
              Object o = Jenkins.XSTREAM2.unmarshal(XStream2.getDefaultDriver().createReader(in), this, null, true);
              if (!o.getClass().equals(getClass())) {
                  // ensure that we've got the same view type. extending this code to support updating
                  // to different view type requires destroying & creating a new view type
                  throw new IOException("Expecting view type: "+this.getClass()+" but got: "+o.getClass()+" instead." +
                      "\nShould you needed to change to a new view type, you must first delete and then re-create " +
                      "the view with the new view type.");
              }
              name = oldname;
              owner = oldOwner;
          } catch (StreamException | ConversionException | Error e) {// mostly reflection errors
              throw new IOException("Unable to read",e);
          }
          save();
      }