Since version 2.7.3 the libxml library (https://bugs.php.net/bug.php?id=49660)
limits parsing in memory files to 10MB. Unfortunately the libxml option
LIBXML_PARSEHUGE to release the 10MB limit is not exposed to php. Through
using the sax parser which is typically used to parse directly from files but
instead chunking the string in memory xml files larger than 10MB can again
be parsed. I copied the exact behaviour of the previous routine
by Hans Anderson (http://www.hansanderson.com/contact/) so compatibility
should be maintained.