More probable:The server or the client is on a windows system, and you're not setting binmode as you write it out (or read it in). Therefore, you're getting newlines translated from one form into another.
Less probable:What do the local settings on the two machines say? Do they differ significantly? Does your XML file contain binary data? Could Perl be doing some funky character set translation on it due to locale misunderstanding?