OOM error by feeding a huge xml to Nokogiri::XML::Reader in JRuby

The pure-java Nokogiri::XML::Reader can't read a huge xml
because it always reads whole file on memory. 

See(Ja): https://twitter.com/#!/eban/status/98629501499613184

To solve this problem, 
I've changed Nokogiri::XML::Reader to use StAX.
It uses less memory and seems to work on better performance.

But it doesn't support Nokogiri::XML::Reader#inner_xml and Nokogiri::XML::Reader#outer_xml.
I didn't come up with how to support these with StAX API.
Does somebody have any idea for this?