Over the years oodles of languages have been used/invented to 
munge SGML/XML in this fashion. Off the top of my head:
 Perl
 Python
 C
 C++
 Balise
 Omnimark
 Adept
 Softquad Sculptor
 Metamorphosis
 tcl
 Scheme
And now, of course, Java.
Because they are all fully fledged programming languages you
can do essentially *anything* with them. You could, for example, adjust
the point size of your HTML headings based on the Netscape
share price pulled live from www.qoute.com divided by
the average seek time of your hard disk:-)
However, a fully blown programming language is overkill
for a lot of rendering applications. You can do a lot with FOSI.
You can do a lot with the Panorama Stylesheet language.
You can do a lot with XSL-Strawman. The people designing
it know full well that there are limits to any declarative
syntax (that is why DSSSL has Scheme built in)
As Larry Wall put it - there is a niche for technologies
that make it easy to go from 0 to 60 but some people
need to go from 60 to 100.
Sean Mc Grath
sean at digitome dot com