WorkerHelper { public static XMLSerializer serializeXML(final Session session, final OutputStream out, final boolean serializeXMLDec, final boolean serializeRest, final Integer revision) { final XMLSerializerBuilder builder; if (revision == null) builder = new XMLSerializerBuilder(session, out); else builder = new XMLSerializerBuilder(session, out, revision); if (serializeRest) { builder.emitRESTful().emitIDs(); } if (serializeXMLDec) { builder.emitXMLDeclaration(); } final XMLSerializer serializer = builder.build(); return serializer; } private  WorkerHelper(); static void shredInputStream(final NodeWriteTrx wtx,
			final InputStream value, final Insert child); static boolean checkExistingResource(final File storagePath,
			final String resource); static XMLSerializer serializeXML(final Session session,
			final OutputStream out, final boolean serializeXMLDec,
			final boolean serializeRest, final Integer revision); static XMLSerializer serializeXML(final Session session,
			final OutputStream out, final boolean serializeXMLDec,
			final boolean serializeRest, final Long nodekey, final Integer revision); StringBuilder createStringBuilderObject(); static void closeWTX(final boolean abortTransaction,
			final NodeWriteTrx wtx, final Session ses, final Database dbase); static void closeRTX(final NodeReadTrx rtx, final Session ses,
			final Database dbase); IDAccessType validateAccessType(final String accessType); static WorkerHelper getInstance();  }
@Test public void testSerializeXML() throws SirixException, IOException { final Database database = Databases.openDatabase(DBFILE.getParentFile()); final Session session = database .getSession(new SessionConfiguration.Builder(DBFILE.getName()).build()); final OutputStream out = new ByteArrayOutputStream(); assertNotNull("test serialize xml", WorkerHelper.serializeXML(session, out, true, true, null)); session.close(); database.close(); out.close(); }