Look in the contrib/xml directory of PostgreSQL. Another option would be to integrate TclDOM in PL/TclU:
rbm@zippy:~$ apt-cache show postgresql-contrib
Package: postgresql-contrib
Priority: optional
Section: misc
Installed-Size: 1480
Maintainer: Oliver Elphick
Description: Additional facilities for PostgreSQL
The PostgreSQL contrib package provides several additional features for
the PostgreSQL database. contrib often serves as a testbed for features
before they are adopted into PostgreSQL proper:
.
...
xml - Manipulate XML documents in the database