<?php
$output = '';
$db = new SQLite3('./.db.db');
$res = $db->query("SELECT * FROM updates");
while ($row = $res->fetchArray()) {
    $url = $row['url'];
    $al_version = $row['al_version'];
    if(!empty($url))
    {
    $output.='<version>'.$al_version.'</version>
';
    }
}
$x = substr($output, -1);
if($x == ",")
{
    $output=substr_replace($output,"",-1);
}
$output.='';
echo $output;
?>