I built a pure Swift XML parser (no DTD, external entity, transcoding support) at https://github.com/compnerd/xylem. Some informal testing indicated that it is faster than libxml2 and xmloxide, a rust port of libxml2.
@helge totally get it (and it was split up to make the change smaller).
The index technique is definitely what I ended up with as well. Except, I have a few different representations as you have the unresolved attributes (raw), and then the resolved attributes (binding URIs for namespace and entity expanded).
Looking forward to comparing notes!