public static Node findOrAddChildNode ( Document doc , Node parentNode , String childName , String childValue ) { Node matchingChild = getChildNode ( parentNode , childName , childValue ) ; return matchingChild != null ? matchingChild : addChildNode ( doc , parentNode , childName , childValue ) ; }
Get the matching child node . Create a node if it doens t already exist