code: private static byte[] transform(final InputStream body) throws IOException {
          final SAXSource source = new SAXSource(new InputSource(body));
          final ByteArrayOutputStream result = new ByteArrayOutputStream();
          try {
              final XMLReader xmlreader = SAXParserFactory.newInstance()
                  .newSAXParser().getXMLReader();
              source.setXMLReader(xmlreader);
              xmlreader.setFeature(
                  RsPrettyXml.LOAD_EXTERNAL_DTD, false
              );
              final String yes = "yes";
              final Transformer transformer = TransformerFactory.newInstance()
                  .newTransformer();
              // @checkstyle MultipleStringLiteralsCheck (2 line)
              transformer.setOutputProperty(
                  OutputKeys.OMIT_XML_DECLARATION, yes
              );
              RsPrettyXml.prepareDocType(body, transformer);
              transformer.setOutputProperty(OutputKeys.INDENT, yes);
              transformer.transform(source, new StreamResult(result));
          } catch (final TransformerException
              | ParserConfigurationException
              | SAXException ex) {
              throw new IOException(ex);
          }
          return result.toByteArray();
      }
docs: Format body with proper indents using SAX.
  @param body Response body
  @return New properly formatted body
  @throws IOException If fails