In SharePoint 2010, I was updating a custom version of the ContentQueryMain.xsl file, needing to include javascript for the page. When I added the following code, the layout of the page changed, the ribbon stopped responding and the page would not respond when in edit mode.
<script type="text/javascript" src="/Script%20Files/myjavascript.js"></script>
Turns out, the XSLT processor didn't care for the empty script tag. Adding the space entity   fixed the problem.
<script type="text/javascript" src="/Script%20Files/myjavascript.js"> </script>