I think you are asking an HTML question rather than an XSLT question. Do you know how to write a dynamic HTML page that achieves this effect? (the usual way is for the onClick method to toggle the CSS class of the relevant elements to switch them from visible to hidden). If you do, then you can write an XSLT transformation that produces this HTML page as output. If you don't, then you need to ask on an HTML forum, not here. Never try to write an XSLT stylesheet, or a program in any other language, until you know what output you want it to produce - in this case, the output is an HTML page.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference