@drscriptt
[brain rummages around in cold storage]
IIRC, you're looking for "SAX" parsers which incrementally process documents, firing events for each node (element, attribute, text, whitespace, processing-instruction, etc) and allowing you to act on those events. As opposed to "DOM" parsers which build up the entire tree in memory.
In both cases, if you're modifying the tree, you generally have to *read* the entire document (and the write the entire modified document back out), but where DOM parsers hold the whole document in memory, SAX parsers don't have to hold the whole document in memory at same time, much like awk(1).
Unfortunately, I'm unaware of any awk-like language for manipulating XML using SAX-like streams, so usually it involves creating custom code in your favorite language using its SAX bindings to do your INSERT/UPDATE/DELETE actions.