code: public static void transform(Source source, Result result, String charset, int indent) {
  		final TransformerFactory factory = TransformerFactory.newInstance();
  		try {
  			final Transformer xformer = factory.newTransformer();
  			if (indent > 0) {
  				xformer.setOutputProperty(OutputKeys.INDENT, "yes");
  				xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent));
  			}
  			if (StrUtil.isNotBlank(charset)) {
  				xformer.setOutputProperty(OutputKeys.ENCODING, charset);
  			}
  			xformer.transform(source, result);
  		} catch (Exception e) {
  			throw new UtilException(e, "Trans xml document to string error!");
  		}
  	}
docs: 将XML文档写出<br>
  格式化输出逻辑参考：https://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java
  
  @param source 源
  @param result 目标
  @param charset 编码
  @param indent 格式化输出中缩进量，小于1表示不格式化输出
  @since 4.0.9