Fix: [xml] boundary check for indexing element children.
Change: [xml] minor improvements.
Add: various minor changes related to stream.