Are you sure the share is accessible via drive letter and not a share name?
You also need to specify a protocol when accessing remote servers.
i.e.
fopen("http://192.168.10.240/sharename/cd1/textxml.xml", "w");
fopen("ftp://usr:pwd@192.168.10.240/sharename/cd1/textxml.xml", "w");
To write to the remote file, I am pretty sure you will need to set write permissions to global users via HTTP.