Say you have references (e.g. xincludes) in one document that you'd like to replace with their contents.
You'd also like to style the result to XHTML for viewing in a browser.
You've got two seperable steps:
Transform the input document replacing references with the referenced--mayve via an XInclude processor.
Transform the result of (1) into XHTML via XSLT.