private void _setMaxOrMinIntensityValues(Node node, int numOfImages,
					   String nodeName, int intensity)
  {
    NamedNodeMap map;
    Node attribute;
    double intensDouble = intensity;
    while(node != null ){
      if(node.getNodeName() == "VARIABLES"){
	NodeList list = node.getChildNodes();
	for(int i = 0; i < list.getLength(); i++){
	  Node nodeForImageMax = list.item(i);

	  // Search for the given nodeName which is either "image-max" or 
	  // "image-min
	  if(nodeForImageMax.getNodeName().equals(nodeName)){
	    NodeList listUnderImageMax = nodeForImageMax.getChildNodes();
	    for(int n = 0; n < listUnderImageMax.getLength(); n++){
	      Node nodeForDATA = listUnderImageMax.item(n);

	      // Search for "DATA"
	      if(nodeForDATA.getNodeName().equals("DATA")){
		NodeList listUnderDATA = nodeForDATA.getChildNodes();
		for(int m = 0; m < listUnderDATA.getLength(); m++){
		  Node nodeForARRAY = listUnderDATA.item(m);

		  // search for "ARRAY"
		  if(nodeForARRAY.getNodeName().equals("ARRAY")){
		    NodeList arrayList = nodeForARRAY.getChildNodes();
		    Node elementNode = null;
		    for(int k = 0; k < numOfImages; k++){
		      elementNode = arrayList.item(k);
		      map = elementNode.getAttributes();
		      attribute = map.getNamedItem("value");
		      attribute.setNodeValue(String.valueOf(intensDouble));
		    }
		    break;
		  }
		}
	      }
	    }
	  }
	}
      }
      node = node.getNextSibling();
    }
  }