in reply to XML::Parser::Expat and non conforming XML

You could create your own IO::Handle, which on the first read returns <root>, subsequently proxies reads to your IO::Zlib and then returns the closing tag when it hits EOF.