Bug 887614 - preserve <head|body> nodes in templates, follow-up of #883787

https://bugzilla.mozilla.org/show_bug.cgi?id=887614