Ah, this triggered an old memory! I used to do integration implementations in Microsoft BizTalk Server, which was all XML based: all of the guts were designed to handle XML documents, so it had out-of-the-box components to translate non-XML ("flat file") messages to/from XML as they were received or sent. These components were universal and designed to operate off of annotations baked into the schemas that represented the XML versions of the messages - things like field sizes, expected locations of line breaks, records that could repeat, etc. The BizTalk developer tools included a schema builder tool ("BizTalk Editor") that helped you autogenerate, construct and mark up schemas with the declarative flat-file translation logic.
I only had to interact with EDI once or twice, but I remember when I discovered that BizTalk shipped with a huge set of premade schemas for most of the X12 and EDIFACT message types, plus extra pluggable components that were "enhanced" versions of the regular translator components that handled the more complex aspects that most "plain" flat files didn't have, mostly stuff around batching/splitting/validating I think. Many of the schemas were gigantic and unbelievably complicated.