http://api.drupal.org/api/function/url/6
Like for the link element:
$output .= "" . url('node/' . $product->nid, array('absolute' => true)) . "\n";
With the url() call the path is translated if custom path exist, with the 'absolute' => true option the hostname is also added to the url i we don't have to check GLOBALS.
Nice module, it deserves to be in a drupal project page in order to submit patches and track bugs.
