PHP socket_write takes a string and length as parameters. I am not sure how can I convert a 4-byte array (xmlHeader) to a string, as some of the bytes are zeroes, i.e.:
xmlHeader = unpack("C*", pack("L", 260));
print_r(xmlHeader);
gives:
Array
(
    [1] => 4
    [2] => 1
    [3] => 0
    [4] => 0
)