XSLT permits customized extensions (the "X" in "XSLT") to be supported by an XSLT processor.
The XSLT language has a mechanism that allows you to call into a component written in any programming language. You could refer to a Java class file, Python program, Perl script or an ActiveX control. You could even embed a small script from a scripting language such as Javascript or Python. The script can be defined right in your stylesheet!