diff --git a/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformer.java b/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformer.java
index 6c8fc6979b..2dfe619636 100644
--- a/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformer.java
+++ b/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformer.java
@@ -127,8 +127,11 @@ private void returnTransformerInstance(MCRCSLTransformerInstance instance, Strin
try {
instance.getCitationProcessor().reset();
instance.getDataProvider().reset();
- instance.getCitationProcessor().setOutputFormat(format);
- instance.getCitationProcessor().setOutputFormat(format);
+ if ("xml".equals(format)) {
+ instance.getCitationProcessor().setOutputFormat(new MCRCSLXMLOutputFormat());
+ } else {
+ instance.getCitationProcessor().setOutputFormat(format);
+ }
} catch (RuntimeException e) {
// if an error happens the instances may be not reset, so we throw away the instance
LogManager.getLogger().error("Error while resetting transformer instance", e);
diff --git a/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformerInstance.java b/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformerInstance.java
index e24bee4de3..7be094730d 100644
--- a/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformerInstance.java
+++ b/mycore-csl/src/main/java/org/mycore/csl/MCRCSLTransformerInstance.java
@@ -50,7 +50,12 @@ public MCRCSLTransformerInstance(String style, String format, AutoCloseable clos
} catch (IOException e) {
throw new MCRConfigurationException("Error while creating CSL with Style " + style, e);
}
- this.citationProcessor.setOutputFormat(format);
+
+ if ("xml".equalsIgnoreCase(format)) {
+ this.citationProcessor.setOutputFormat(new MCRCSLXMLOutputFormat());
+ } else {
+ this.citationProcessor.setOutputFormat(format);
+ }
}
public CSL getCitationProcessor() {
diff --git a/mycore-csl/src/main/java/org/mycore/csl/MCRCSLXMLOutputFormat.java b/mycore-csl/src/main/java/org/mycore/csl/MCRCSLXMLOutputFormat.java
new file mode 100644
index 0000000000..3f295f56f3
--- /dev/null
+++ b/mycore-csl/src/main/java/org/mycore/csl/MCRCSLXMLOutputFormat.java
@@ -0,0 +1,53 @@
+/*
+ * This file is part of *** M y C o R e ***
+ * See https://www.mycore.de/ for details.
+ *
+ * MyCoRe is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * MyCoRe is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MyCoRe. If not, see