Sync from xmltool
Add functions to copy/paste elements