Not 100% sure if I understood your database design correctly, but it could be something in the following style:
Code:
<html><body><table><th><td>A</td><td>B</td><td>C</td></th>
<?php
$database = 'SAMPLE'; $user = 'db2inst1'; $password = 'ibmdb2';
$conn = db2_connect($database, $user, $password);
$sql =
'SELECT XMLQUERY(\'$Y/A\' PASSING Y) AS a,
XMLQUERY(\'$Y/B\' PASSING Y) AS b,
XMLQUERY(\'$Y/C\' PASSING Y) AS c
FROM x';
$stmt = db2_prepare($conn, $sql);
$result = db2_execute($stmt);
while ($row = db2_fetch_array($stmt)) {
print "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td></tr>";
} ?>
</table></body></html>
For the DB2 bindings in PHP, and how to install, see
PHP: IBM DB2 Functions - Manual