public void setUniqueChildElementByNameNs(ModelElementInstance newChild) {
ModelUtil.ensureInstanceOf(newChild, ModelElementInstanceImpl.class);
ModelElementInstanceImpl newChildElement = (ModelElementInstanceImpl) newChild;
DomElement childElement = newChildElement.getDomElement();
ModelElementInstance existingChild = getUniqueChildElementByNameNs(childElement.getNamespaceURI(), childElement.getLocalName());
if(existingChild == null) {
addChildElement(newChild);
} else {
replaceChildElement(existingChild, newChildElement);
}