I have written a converter that takes openstreetmap xml files and converts them to a binary runtime rendering format that is typically about 10% of the original size. Input file
It sounds like you're already doing a SAX based approach to the XML processing (loading the XML as you go instead of all at once).
The solution is almost always to change the algorithm so that it cuts the problem into smaller parts. Physically don't allocate as much memory at one time, read in only what you need, process it, then write it out.
You can sometimes extend memory via using the hard drive instead when needed in your algorithm.
If you can't split up your algorithm, you probably want something like memory mapped files.
In the worst case you can try to use something like VirtualAlloc if you are on a windows system. If you are on a 32-bit system you can try to use something like Physical Address Extension (PAE).
You could also consider putting input limitations for your program, and having a different one for 32-bit and 64-bit systems.