> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/documentacion-editran-editran-sepa-v3-open-en/uso-de-la-zona-libre-de-los-registros/xml-a-plano.md).

# XML to flat file

The values transferred from the XML-format file and the records and positions where they are placed in the flat-format file are described below. All those positions in the free areas that are not used with this functionality will remain blank.

**Issuance of transfers and checks:**

The content of:

* `<GrpHdr><MsgId>` to position 290 of the payer header record.
* `<PmtInf><DbtrAcct><Ccy>` to position 325 of the payer header record, provided the value is different from "EUR".
* `<GrpHdr><InitgPty><Id><OrgId><Othr><Id>` to position 328 of the payer header record.
* "XML" is written in position 598 of the payer header record.
* `<PmtInf><PmtInfId>` to position 23 of the header records for SEPA transfers, other transfers, or checks, depending on the block type from which the data comes.
* The value of the attribute `Ccy` of `<PmtInf><CdtTrfTxInf><Amt><InstdAmt Ccy="XXX">` or of `<PmtInf><CdtTrfTxInf><Amt><EqvAmt><Amt Ccy="XXX">`, provided it is different from "EUR", in position 502 of the first mandatory beneficiary record if the source block is a SEPA Transfer or in position 333 of the same record if the source block is of the Other Transfers type.
* `<PmtInf><CdtTrfTxInf><Amt><EqvAmt><CcyOfTrf>` to position 505 of the first mandatory beneficiary record if the source block is a SEPA Transfer or in position 336 of the same record if the source block is of the Other Transfers type.
* `<PmtInf><CdtTrfTxInf><XchgRateInf><XchRate>` to position 508 of the first mandatory beneficiary record if the source block is a SEPA Transfer or in position 339 of the same record if the source block is of the Other Transfers type.
* `<PmtInf><CdtTrfTxInf><XchgRateInf><RateTp>` to position 521 of the first mandatory beneficiary record if the source block is a SEPA Transfer or in position 352 of the same record if the source block is of the Other Transfers type.
* `<PmtInf><CdtTrfTxInf><XchgRateInf><CtrctId>` to position 525 of the first mandatory beneficiary record if the source block is a SEPA Transfer or in position 356 of the same record if the source block is of the Other Transfers type.
* `<GrpHdr><CtrlSum>` to position 41 of the \[General Total Record] if it contains 18 digits.
* `<GrpHdr><NbOfTxs>` to position 59 of the \[General Total Record] if it contains more than 8 digits.
* `<PmtInf><CtrlSum>` to position 41 of the \[SEPA Transfers Total Record], \[Other Transfers Total Record], or \[Checks Total Record], as appropriate by block type, when it contains 18 digits.
* `<PmtInf><NbOfTxs>` to position 59 of the \[SEPA Transfers Total Record], \[Other Transfers Total Record], or \[Checks Total Record], as appropriate by block type, when more than 8 digits.
* `<SchmeNm><Prtry>` (both legal entity and natural person) to positions 405-440 of the \[Optional Third Beneficiary Record].
* Booklet versions in SEPA Transfer Block:

  * XML files with value `SDCL` in `<LclInstrm><Cd>`, are converted to flat files of booklet version 34156.
  * XML files with value `HIGH` in `<InstrPrty>`, are converted to flat files of booklet version 34167.
  * XML files with value `INST` in `<LclInstrm><Cd>`, are converted to flat files of booklet version 34171.
  * XML files with value `VOP` in `<LclInstrm><Prtry>`, are converted to flat files of booklet version 34182.

  Since the version is a piece of data in the \[Payer Header Record], the logical file can only have blocks corresponding to one of these booklet versions.
* The value `URGP` in `<SvcLvl>` to:
  * If `<PmtTpInf>` is provided at payment block level (`<PmtInf>`), position 58 of the \[Other Transfers Payer Header Record].
  * If `<PmtTpInf>` is provided at individual transaction level (`<CdtTrfTxInf>`), position 426 of the \[First Beneficiary Record of Other Transfers].
* The beneficiary name of non-SEPA transfer blocks to position 430 of the \[First Beneficiary Record of Other Transfers] when its length is greater than 35. When the name length is 35 or less, the data continues to be mapped to position 107.

**Direct debits (basic and B2B schemes):**

* "XML" is written in position 598 of the presenter header record.
* Presentations, the content of:
  * `<GrpHdr><Authstn><Prtry>` to position 167 of the \[Presenter Header Record].
  * `<PmtInf><PmtInfId>` to position 300 of the \[Creditor Header Record by collection date].
  * `<PmtInf><BtchBookg>` to position 335 of the \[Creditor Header Record by collection date] according to the following conversion: if it contains `true` is written `0` and if it contains `false` is written `1`.
  * Basic scheme only: `<DrctDbtTxInf><PmtId><InstrId>` to position 365 of the \[Optional Second Individual Record].
  * Basic scheme only: `<OrgnlDbtrAgt><FinInstnId><BIC>` or `<OrgnlDbtrAgt><FinInstnId><Othr><Id>` to field 10 together with the first 6 positions of the free field that follows it in the \[Optional Fourth Individual Record].
  * `<DrctDbtTxInf><MndtRltdInf><ElctrncSgntr>` to two new optional individual records that are written after the last existing optional individual record. The first of them has data number "507" and includes the first 525 positions of the tag value, ending with 65 free positions. The second of them has data number "508" and includes the next 500 positions of the tag value, ending with 90 free positions.
  * `<PmtInf><CtrlSum>` to position 81 of the \[Creditor Total Record by collection date]. It will be used to capture amounts of 18 digits in total (the flat-format standard allows up to 17).
  * `<PmtInf><NbOfTxs>` to position 99 of the \[Creditor Total Record by collection date]. It will be used to capture individual record numbers whose value exceeds the 8 digits allowed by the flat format.
* Rejections, originator information. 11 positions are transferred from the content of the first of the following tags found in the file:

  * `<OrgnlGrpInfAndSts><StsRsnInf><Orgtr><Id><OrgId><BICorBEI>` or of
  * `<OrgnlGrpInfAndSts><StsRsnInf><Orgtr><Nm>` or of
  * `<OrgnlPmtInfAndSts><StsRsnInf><Orgtr><Id><OrgId><BICorBEI>` or of
  * `<OrgnlPmtInfAndSts><StsRsnInf><Orgtr><Nm>` or of
  * `<OrgnlPmtInfAndSts><TxInfAndSts><StsRsnInf><Orgtr><Id><OrgId><BICorBEI>` or of
  * `<OrgnlPmtInfAndSts><TxInfAndSts><StsRsnInf><Orgtr><Nm>`

  to position 586 of each \[First Individual Record].
* Reversals, the content of:
  * `<OrgnlPmtInfAndRvsl><OrgnlCtrlSum>` to position 81 of the \[Creditor Total Record by collection date]. It will be used to capture amounts of 18 digits in total (the flat-format standard allows up to 17).
  * `<OrgnlPmtInfAndRvsl><OrgnlNbOfTx>` to position 99 of the \[Creditor Total Record by collection date]. It will be used to capture individual record numbers whose value exceeds the 8 digits allowed by the flat format.
* Presentations and reversals, the content of:
  * `<GrpHdr><CtrlSum>` to position 38 of the \[General Total Record]. It will be used to capture amounts of 18 digits in total (the flat-format standard allows up to 17)
  * `<GrpHdr><NbOfTxs>` to position 56 of the \[General Total Record] if the amount exceeds the 8 digits allowed by the flat format.
* Rejections and returns, the content of:
  * `<OrgnlPmtInfAndSts><OrgnlCtrlSum>` to position 81 of the \[Creditor Total Record by collection/return date]. It will be used to capture amounts of 18 digits in total (the flat-format standard allows up to 17).
  * `<OrgnlPmtInfAndSts><OrgnlNbOfTx>` to position 99 of the \[Creditor Total Record by collection/return date]. It will be used to capture individual record numbers whose value exceeds the 8 digits allowed by the flat format.
  * `<OrgnlGrpInfAndSts><OrgnlCtrlSum>` to position 38 of the \[General Total Record]. It will be used to capture amounts of 18 digits in total (the flat-format standard allows up to 17).
  * `<OrgnlGrpInfAndSts><OrgnlNbOfTxs>` to position 56 of the \[General Total Record]. It will be used to capture individual record numbers whose value exceeds the 8 digits allowed by the flat format.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.editran.onesait.com/documentacion-editran/documentacion-editran-editran-sepa-v3-open-en/uso-de-la-zona-libre-de-los-registros/xml-a-plano.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
