Understanding data length
Only 2%?
Check the line terminators.  For the column, do something like SELECT HEX(LEFT(COL(100))).  For the file, do something like od or hd or take the cat to the vet (cat -vet).
A Rule of Thumb is that an average line of &quot;text&quot; is 30 characters, which would lead to about a 3% difference.  XML is rather verbose, and your data may be averaging 50 bytes per &quot;line&quot;.