Format and compress XML documents