You should create your own PHP script with the necessary logic.
And further use it output via IFrame or Ajax.
To use X-Cart functions in the script you should start the script as follows:
PHP Code:
<?php
require "./auth.php";
#your code goes here
?>
Use home.php/minicart.php as a sample.