XmlSerializer extends org.sirix.service.AbstractSerializer<XmlNodeReadOnlyTrx, XmlNodeTrx> { private XmlSerializer(final XmlResourceManager resourceMgr, final @Nonnegative long nodeKey, final XmlSerializerBuilder builder, final boolean initialIndent, final @Nonnegative int revision, final int... revsions) { super(resourceMgr, builder.maxLevel == -1 ? null : new XmlMaxLevelVisitor(builder.maxLevel), nodeKey, revision, revsions); out = new BufferedOutputStream(builder.stream, 4096); indent = builder.indent; serializeXMLDeclaration = builder.declaration; serializeRest = builder.rest; serializeRestSequence = builder.restSequence; serializeId = builder.id; indentSpaces = builder.indentSpaces; withInitialIndent = builder.initialIndent; emitXQueryResultSequence = builder.emitXQueryResultSequence; serializeTimestamp = builder.serializeTimestamp; metaData = builder.mMetaData; } private  XmlSerializer(final XmlResourceManager resourceMgr, final @Nonnegative long nodeKey,
      final XmlSerializerBuilder builder, final boolean initialIndent, final @Nonnegative int revision,
      final int... revsions); static void main(final String... args); static XmlSerializerBuilder newBuilder(final XmlResourceManager resMgr, final OutputStream stream,
      final int... revisions); static XmlSerializerBuilder newBuilder(final XmlResourceManager resMgr, final @Nonnegative long nodeKey,
      final OutputStream stream, final XmlSerializerProperties properties, final int... revisions);  }
@Test public void testXMLSerializer() throws Exception { final var database = XmlTestHelper.getDatabase(PATHS.PATH1.getFile()); try (final XmlResourceManager manager = database.openResourceManager(XmlTestHelper.RESOURCE); final XmlNodeTrx wtx = manager.beginNodeTrx(); final ByteArrayOutputStream out = new ByteArrayOutputStream()) { XmlDocumentCreator.create(wtx); wtx.commit(); final XmlSerializer serializer = new XmlSerializerBuilder(manager, out).emitXMLDeclaration().build(); serializer.call(); assertEquals(XmlDocumentCreator.XML, out.toString(Constants.DEFAULT_ENCODING.toString())); } }