When generating XML files with the Mustangproject v2.16.2 and using setCorrection on the invoice, I get an invalid XML.
A Java fragment:
Invoice invoice = new Invoice();
/*using some setters except `setCorrection` */
invoice.setCorrection("test-123");
Excerpt from the generated XML file (the element InvoiceReferencedDocument appears twice with the same contents):
<ram:InvoiceReferencedDocument>
<ram:IssuerAssignedID>test-123</ram:IssuerAssignedID>
</ram:InvoiceReferencedDocument>
<ram:InvoiceReferencedDocument>
<ram:IssuerAssignedID>test-123</ram:IssuerAssignedID>
</ram:InvoiceReferencedDocument>
The XML is generated like this:
ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
zf2p.setProfile(Profiles.getByName("XRechnung", 3));
zf2p.generateXML(invoice);
String theXML = new String(zf2p.getXML());
I'm using Java-22, but the problem is present with Java-21 (LTS), too.