Create/add XML collections depending on output bundles

Hello,

I want to create an XML file with as many collections as I have bundles from the previous module.

If I have 5 bundles, I want the XML file to have 5 collections and so on …

How can this be created? Is there a way to loop & add collections to XML data?

Thanks
David

That should be possible. Do you have example data on your inputs and what you wish to output?

This is the XML data for “1 payment”, for each payment I want to add a CdtTrfTxInf to the XML data. I’m trying to create something with the Data Store, but no succes yet

<?xml version="1.0" encoding="UTF-8"?>
<Document
	xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<CstmrCdtTrfInitn>
		<GrpHdr>
			<MsgId>1234</MsgId>
			<CreDtTm>2023-09-10T09:59:15</CreDtTm>
			<NbOfTxs>1</NbOfTxs>
			<CtrlSum>5253.00</CtrlSum>
			<InitgPty>
				<Nm>test bv</Nm>
			</InitgPty>
		</GrpHdr>
		<PmtInf>
			<PmtInfId>0095331</PmtInfId>
			<PmtMtd>TRF</PmtMtd>
			<BtchBookg>false</BtchBookg>
			<NbOfTxs>1</NbOfTxs>
			<CtrlSum>553.00</CtrlSum>
			<ReqdExctnDt>2023-09-11</ReqdExctnDt>
			<Dbtr>
				<Nm>test bv</Nm>
			</Dbtr>
			<DbtrAcct>
				<Id>
					<IBAN>BE9773605035XXXX</IBAN>
				</Id>
			</DbtrAcct>
			<DbtrAgt>
				<FinInstnId>
					<BIC>KREDBEBB</BIC>
				</FinInstnId>
			</DbtrAgt>
			<CdtTrfTxInf>
				<PmtId>
					<EndToEndId>4955</EndToEndId>
				</PmtId>
				<Amt>
					<InstdAmt Ccy="EUR">553.00</InstdAmt>
				</Amt>
				<CdtrAgt>
					<FinInstnId>
						<BIC>ARSPBE22</BIC>
					</FinInstnId>
				</CdtrAgt>
				<Cdtr>
					<Nm>CRP080222BBE09</Nm>
					<PstlAdr>
						<Ctry>BE</Ctry>
					</PstlAdr>
				</Cdtr>
				<CdtrAcct>
					<Id>
						<IBAN>BE2297339718XXXX</IBAN>
					</Id>
				</CdtrAcct>
				<RmtInf>
					<Ustrd>D02/00000057 -/- CRP080222B09 </Ustrd>
				</RmtInf>
			</CdtTrfTxInf>
		</PmtInf>
	</CstmrCdtTrfInitn>
</Document>```

Could you please post the content of a sample bundle?

also, there is a module that converts JSON to XML, check this post which has a solution:

The output comes from a Monday module from which I get some variables I want to use to fill in the XML collections.