code: public void serialize(DigitalObject obj,
                            OutputStream out,
                            String encoding,
                            int transContext) throws ObjectIntegrityException,
              StreamIOException, UnsupportedEncodingException {
          logger.debug("Serializing {} for transContext: {}",
                  m_format.uri, transContext);
          OutputStreamWriter osWriter = new OutputStreamWriter(out, encoding);
          PrintWriter writer = new PrintWriter(new BufferedWriter(osWriter));
          try {
              appendXMLDeclaration(obj, encoding, writer);
              appendRootElementStart(obj, writer, transContext);
              appendProperties(obj, writer, encoding);
              appendAudit(obj, writer, encoding, transContext);
              appendDatastreams(obj, writer, encoding, transContext);
              if (m_format.equals(FOXML1_0)) {
                  appendDisseminators(obj, writer);
              }
              appendRootElementEnd(writer);
          } finally {
              writer.close();
          }
      }
docs: {@inheritDoc}