XSLT is used to transform XML documents into other formats like HTML. It uses two input files - the XML data file and an XSL stylesheet file containing templates that specify how to insert the XML data and transform it. The XSLT file uses elements like <xsl:value-of> to output node values and <xsl:for-each> to loop through nodes, and attributes like select to specify nodes to operate on. Templates in the XSLT file are matched to nodes using attributes like match to transform the XML into the desired output format.