I have tried to create a Name key to store the name and a children key to store these parts in sequence. But as a result, it cannot be converted back to xml using map2xml.
Map:
B4X:
(MyMap) {g={Attributes={id=1}, Name=g, children=[Styles like , {Attributes={id=2}, Name=g, children=bold}, is supported.]}}
1. Such XML cannot be represented with a map so it will never work with Xml2Map.
2. You can parse it with MiniHtmlParser. I don't know whether it will be simpler than jSoup.
B4X:
Dim parser As MiniHtmlParser
parser.Initialize
Dim root As HtmlNode = parser.Parse(File.ReadString("C:\Users\H\Downloads\321880_ms.docx.xlf", ""))
parser.PrintNode(root)
I found that after a text node is added, XMLBuilder no longer allows adding an element, which will throw an IllegalStateException (see: assertElementContainsNoOrWhitespaceOnlyTextNodes) . I have posted an issue about this.