if (targetDS == null) {
copyOMElement(factory, targetParent, sourceOMSE);
return;
}
// Otherwise create a target OMSE with the copied DataSource
OMSourcedElement targetOMSE =
factory.createOMElement(targetDS,
sourceOMSE.getLocalName(),
sourceOMSE.getNamespace());
targetParent.addChild(targetOMSE);