How can repeating nested elements be handled in ES docs

I have a B2B record that I am publishing to ES that has nested repeating elements. e.g.
E1[0]
E1[0][0]
E1[0][1]
/E1[0]
E1[1]
E1[1][0]
E1[1][1]
/E1[1]
How can this be defined in an ES document?

It’s a little funky. The XML would look like this (using square brackets instead of angle brackets for this forum):

[myDoc]
[e1]
[e1]
[e1]000[/e1]
[e1]001[/e1]
[/e1]
[e1]
[e1]010[/e1]
[e1]011[/e1]
[/e1]
[/e1]
[e1]
[e1]
[e1]100[/e1]
[e1]101[/e1]
[/e1]
[e1]
[e1]110[/e1]
[e1]111[/e1]
[/e1]
[/e1]
[/myDoc]

In B2B, you can generate a record that looks like this:

myDoc (record)
e1 (record list)
e1 (record list)
e1 (string list)

In ES, the corresponding doc type would look like this:

myDoc (struct)
e1 (struct seq)
e1 (struct seq)
e1 (string sequence)

This should provide bi-directional exchange of docs. You can try to use a multi-dimensional sequence in ES (e.g. string e1) but that isn’t handled well by B2B.

Hope this helps.