See question here How do you parse and process HTML/XML in PHP?
You can use SimpleXML (see http://php.net/manual/en/simplexml.examples-basic.php) for parsing
$xmlStr = '<?xml version="1.0" encoding="UTF-8"?><Response Code="200"><Description>http://sample.net</Description><URL>/Patient/PatientView.aspx?pid=642</URL></Response>';
$response = new SimpleXMLElement($xmlStr);
$url = (string) $response->Description . (string) $response->URL;
$url
will contain:
http://sample.net/Patient/PatientView.aspx?pid=642
Then use PDO
(http://php.net/manual/en/book.pdo.php) to store data into database:
try {
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
$stmt = $dbh->prepare("INSERT INTO sample (url) VALUES (:url)");
$stmt->bindParam(':url', $url);
$stmt->execute();
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}