[FIX] flush data after seeing end of XML file