public static ArrayList ExpandNodeName(String n) {
	ArrayList names = new ArrayList();
	int nlen = n.length();
	int index = 0;

	while (index < nlen) {
	    int end = n.indexOf(',',index);
	    if (end == -1) end = nlen;

	    String next = (index > 0 || end < nlen) ? n.substring(index,end) : n;

	    int dup = next.indexOf('#');
	    if (dup == -1) ExpandIterators(names,"",next);
	    else {
		try {
		    int count = Integer.parseInt(next.substring(dup+1,end));
		    if (count > 0) {
			// found out what to duplicate
			ExpandIterators(names,"",next.substring(0,dup));
			int nnames = names.size();
			// now perform the duplication (remember first
			// copy is already in the names vector!)
			while (count-- > 1) {
			    for (int i = 0; i < nnames; i += 1)
				names.add(names.get(i));
			}
		    }
		}
		catch (NumberFormatException e) {
		    ExpandIterators(names,"",next);
		}
	    }

	    index = end + 1;
	}

	return names;
    }