XML reader simplified, binary XML format clarified
Made XML reader simplier (hopefully easier to understand) and removed some bugs.
Binary XML read and writer improved, refactored code, removed redundances, and clarified binary format assumptions.