Added version attribute. Now copies entire subtree of a layer (including text content).