I wonder if there might be a DOM-like JSON/XML parser + generator library which allows one to search the in-memory nodes (after parsing / before unparsing) by name in an efficient way (better than linear). That is, having at least logarithmic time such as that in Bynary Search Trees and the like (so analogous to
Map implementations in Java).
This is because I'll have a multi-level hierarchy with on-the-fly/dynamic names (data based), kept in memory during whole program execution (basically for a Spring server), that are subject to be updated at any time originating from client requests. And so that I wouldn't have to use some
Map object for holding the in-memory tree instead before generating the JSON/XML files that would imply converting the data to the library, in an effort to avoid the usual impedance missmatch.
Searching for DOM-like libraries that use logarithmic or efficient time access (for the in-memory nodes) I can't find anything mentioning that.
EDIT: JSON is preferred.