code: public static byte[] prettyPrint(byte[] inBytes,
                                       boolean omitXMLDeclaration)
              throws IOException {
          ByteArrayOutputStream sink = new ByteArrayOutputStream();
          prettyPrint(new ByteArrayInputStream(inBytes),
                  new OutputStreamWriter(sink, "UTF-8"), omitXMLDeclaration);
          return sink.toByteArray();
      }
docs: Pretty-prints the given XML.
  <p>
  The input must be well-formed. The transformation has the following
  effect:
  <ul>
  <li> Leading and trailing whitespace will be removed.</li>
  <li> All processing instructions and doctype declarations will be
  removed.</li>
  <li> If Xalan is the currently active XML transformer (true by
  default in Java 6), it will be reformatted to have two-space
  indents. Otherwise, indenting behavior is undefined (it may or
  may not be indented).</li>
  <li> Attributes will use double-quotes around values.</li>
  <li> All empty elements (e.g.
  <code>&lt;element&gt;&lt;element&gt;</code>) will be
  collapsed (e.g. <code>&lt;element/&gt;</code></li>
  </ul>
  
  @param inBytes the xml to be pretty-printed.
  @param omitXMLDeclaration whether to omit the xml declaration in the
  output. If false, the output will not be directly embeddable in
  other XML documents.
  @return the pretty-printed XML as a UTF-8 encoded byte array.
  @throws IOException