I’ve written an XSLT dependency viewer for EMACS. It’s very similar to the package found here http://www.thoughtcrime.us/software/xslt-dependency-graph/. However, that library is for XLST 2.0 while I have to use XSLT 1.0 at work.
The parsing of the files to traverse the import/includes is done in EMACS lisp, which generates a dot diagram. That is then piped into the graphviz dot data visualization program and opened in your favorite PDF viewer. Graphviz is like LaTeX but for generating graphs of all kinds. Check out this graphviz dot guide that will give you an idea what it is capable of. Pretty powerful stuff.