I've recently run into a similar problem. I ran the security assist to build log-in and registration pages. When they were done I wanted to apply a theme. It told me to apply a template first. When I do that it warns that ""The template that this document is based on does not allow changes outside the <html> tag. The changes you made will be discarded" I resolve the regions to the head and body, and most of the code disappears. Is the only thing I can do is to copy the code out from the page before applying the template then paste it into the page after applying the theme? Seems kind of cumbersome.