'Returns a copy of the specified element.
The element to copy is specified using ``source`` and ``xpath``. They
have exactly the same semantics as with `Get Element` keyword.
If the copy or the original element is modified afterwards, the changes
have no effect on the other.
Examples using ``${XML}`` structure from `Example`:
| ${elem} =  | Get Element  | ${XML}  | xpath=first |
| ${copy1} = | Copy Element | ${elem} |
| ${copy2} = | Copy Element | ${XML}  | xpath=first |
| Set Element Text         | ${XML}   | new text    | xpath=first      |
| Set Element Attribute    | ${copy1} | id          | new              |
| Elements Should Be Equal | ${elem}  | <first id="1">new text</first> |
| Elements Should Be Equal | ${copy1} | <first id="new">text</first>   |
| Elements Should Be Equal | ${copy2} | <first id="1">text</first>     |'

def copy_element(self, source, xpath='.'):

    return copy.deepcopy(self.get_element(source, xpath))
