code: public static XMLSerializer serializeXML(final ISession session, final OutputStream out,
          final boolean serializeXMLDec, final boolean serializeRest, final Long revision) {
          final XMLSerializerBuilder builder;
          if (revision == null)
              builder = new XMLSerializerBuilder(session, out);
          else
              builder = new XMLSerializerBuilder(session, out, revision);
          builder.setREST(serializeRest);
          builder.setID(serializeRest);
          builder.setDeclaration(serializeXMLDec);
          final XMLSerializer serializer = builder.build();
          return serializer;
      }
docs: This method creates a new XMLSerializer reference
  
  @param session
  Associated session.
  @param out
  OutputStream
  
  @param serializeXMLDec
  specifies whether XML declaration should be shown
  @param serializeRest
  specifies whether node id should be shown
  
  @return new XMLSerializer reference