Seeking Assistance

I am currently trying to develop a program which will perform an HTTP GET to our inventory hosted on a third party vendor. I am capable of getting into the database and have a response coming back. When I run the program (E.g. inventory.php) and viewthe page source I see the XML. My question is how do I go about saving that XML into a document or a string for use later in parsing out into tables?

This is my code as of now.

[COLOR=red]<?php[/COLOR]

$path = [COLOR=red]"[/COLOR][COLOR=red]/cdmapi/dlapi.asmx/DLAPI?Request=string&DealerID=string&LoginID=string&Password=string[/COLOR][COLOR=red]"[/COLOR];
$port = [COLOR=red]80[/COLOR];
$host = [COLOR=red]“api.cdmdata.com”[/COLOR];

[COLOR=green]if[/COLOR] ([COLOR=blue]count/COLOR > [COLOR=red]1[/COLOR]) $path = $argv[[COLOR=red]1[/COLOR]];
[COLOR=green]if[/COLOR] ([COLOR=blue]count/COLOR > [COLOR=red]2[/COLOR]) $port = $argv[[COLOR=red]2[/COLOR]];
[COLOR=green]if[/COLOR] ([COLOR=blue]count/COLOR > [COLOR=red]3[/COLOR]) $host = $argv[[COLOR=red]3[/COLOR]];
$address = [COLOR=blue]gethostbyname/COLOR;
$socket = [COLOR=blue]socket_create[/COLOR](AF_INET, SOCK_STREAM, SOL_TCP);
[COLOR=blue]socket_connect[/COLOR]($socket, $address, $port);
$in = [COLOR=red]"GET $path HTTP/1.0

"[/COLOR];
[COLOR=blue]socket_write[/COLOR]($socket, $in, [COLOR=blue]strlen/COLOR);

[COLOR=green]while[/COLOR] ($out = [COLOR=blue]socket_read[/COLOR]($socket, [COLOR=red]4096[/COLOR])) {
[COLOR=blue]echo[/COLOR] $out;
}

[COLOR=blue]socket_close/COLOR;

[COLOR=red]?>[/COLOR]

[COLOR=black]Thank you much in advance. Also if you have an links to any tutorials on this subject it would be greatly appreciated. [/COLOR]

You may contact me directly with any advice. [email protected]