Not an ideal solution, but I've used sub-SELECTs to alias the PIVOT columns with names that can be used in XML. Example from a customized issues list:
SELECT Client,
"P1::C" AS P1, "P2::C" AS P2, "P3::C" AS P3, "P4::C" AS P4,
COALESCE("P1::C", 0) + COALESCE("P2::C", 0) + COALESCE("P3::C", 0) + COALESCE("P4::C", 0) AS Total FROM
(
SELECT Client, Priority, COUNT(*) AS C
FROM CurrentOpen
GROUP BY Client, Priority
PIVOT C BY Priority IN (1 AS P1,2 AS P2,3 AS P3,4 AS P4)
) x
ORDER BY Client
Adam |