#!/usr/bin/env php xpath('//item') as $item) { $key = (string) $item->key; $keyUrl = 'http://tracker.phpbb.com/browse/' . $key; $keyLink = '' . $key . ''; $value = str_replace($key, $keyLink, htmlspecialchars($item->title)); $value = str_replace(']', '] -', $value); $types[(string) $item->type][$key] = $value; } ksort($types); foreach ($types as $type => $tickets) { echo "

$type

\n"; echo "\n"; }