// Use a create xpath instead of just setAttribute on the
// target as only the former method creates (or ensures is
// created) the "whole path" from source to target (e.g. if
// latter is grandchild)
// NOTE that this is ok even where sourceToTargetPath==null
final ODOMXPath createPath =
new ODOMXPath(sourceToTargetPath, newAttribute);
// This just creates an EMPTY attribute.......
final ODOMAttribute createdAttribute =
(ODOMAttribute) createPath.
create(sourceElement, odomFactory);
// ....but in doing so it might have created us a new target:
// first check whether it was originally null
if (targetElement == null) {