for (Node currentSerNode : domainsNode.getChildNodes()) {
String prop = Constants.SUB_DOMAIN_ELEMENT;
if(serNode.getName().equals(currentSerNode.getName()) &&
serNode.getProperty(prop).equals(currentSerNode.getProperty(prop))){
// if domain and sub domain, are matching, we should remove the node.
domainsNode.removeChildNode(currentSerNode.getName());
if(domainsNode.getChildNodes().size() == 0){
// if no cluster definitions remain, we shouldn't keep the node
currentNodeToBeRemoved = aNode;
}
break;