OutputFormat (SchemaType outputType) { return switch (outputType) { case DTD -> new DtdOutputFormat(); case RNC -> new RncOutputFormat(); case RNG -> new RngOutputFormat(); case XSD -> new XsdOutputFormat(); default -> { assert false : "Unsupported output type: " + outputType; yield null; } }; }