properly strip comments/text nodes
partially fixes #81 (except named templates)