Fix for saving document as template multiple times. Issue: #1586
A temporary node is added to the current document to save it as a template with template info but not removed after saving the copy of document as file. Removing that node after it's use.