I'm curious now. Let's say you executed these various things, what output do you get:
First, make a file filled with around 1000 'x' characters. Then:
<?php
$fp = fopen("x.txt", "r");
$teststr = fread($fp, filesize("x.txt"));
echo $teststr;
?>
And how about if you just do:
<?php
$teststr = "";
for ($x = 0; $x < 1024; $x++) {
$teststr .= "x";
}
echo $teststr;
?>
If either of those fails to print the full string expected, then add this line before each echo:
print "Line size is " . strlen($teststr) . "<BR>\n";
Maybe this can give a clue as to what the issue is. If you have the same problem with fread, though, it isn't an issue with XML.