@Override
public Object copy(Object arg, DataType dataType, DataType targetDataType, Operation operation, Operation targetOperation) {
HelperContext context = SDOContextHelper.getHelperContext(operation);
CopyHelper copyHelper = context.getCopyHelper();
if (arg instanceof XMLDocument) {
XMLDocument document = (XMLDocument)arg;
DataObject dataObject = copyHelper.copy(document.getRootObject());
return context.getXMLHelper().createDocument(dataObject,
document.getRootElementURI(),
document.getRootElementName());
} else if (arg instanceof DataObject) {
return context.getCopyHelper().copy((DataObject)arg);
} else {
return super.copy(arg, dataType, targetDataType, operation, targetOperation);
}