code: public Marshaller createMarshaller(String encoding) {
          try {
              Marshaller marshaller = jaxbContext.createMarshaller();
  
              marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
  
              if (StringUtils.isNotBlank(encoding)) {
                  marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
              }
              return marshaller;
          } catch (JAXBException e) {
              throw new RuntimeException(e);
          }
      }
docs: 创建Marshaller, 设定encoding(可为Null).