Is there an option to ask BaseX to parse only a part of the imported xml files under a specific xpath, (or at least limit useless indexing of non relevant components)? I don't need the rest of the xml files, even though it's not too big. Maybe it can help.
The usual approach is to simply create another database that only contains the relevant parts of your document. This can directly be done in XQuery (using db:create, db:add, ...), or, if memory consumption is too high, by exporting and importing parts of your document.
Hope this helps, Christian