private void printNaryRelHelp(ORASSNode node1, ORASSNode node2, String relName, int node2Index, List<String> entityOrder, CachedRowSet data, String id, int indentation) throws MainException{
		try{
			String table1 = node1.getName();
			String table2 = node2.getName();
			List<String> cols1 = keyMaps.get(table1);
			List<String> cols2 = keyMaps.get(table2);
			List<ColumnDetail> relCols = node2.getRelAttributes();

			List<String> pkVals = getSelectedVals(table1, cols1, data);
			String currID = this.getTupleID(table1, pkVals);
			if(currID.equals(id)){
				List<String> pkVals2 = getSelectedVals(table2, cols2,data);
				String refID = getTupleID(table2, pkVals2);
				printTabs(indentation);
				writer.println("<"+table2+" " +table2+"_Ref=\""+refID+"\">");
				if(node2Index<entityOrder.size()-1){
					String nextEntity = entityOrder.get(node2Index+1);
					List<ORASSNode> children2 = node2.getChildren();

					for(int i=0; i<children2.size(); i++){
						ORASSNode child = children2.get(i);
						String childName = child.getName();
						if(childName.equals(nextEntity)){
							printNaryRelHelp(node2, child, relName, node2Index+1, entityOrder, data, refID, indentation+1);
						}
					}
				}else{
					// Print relationship attributes
					for(int i=0; i<relCols.size(); i++){
						ColumnDetail col= relCols.get(i);

						String tName = col.getTableName();
						if(tName.equals(relName)){
							String colName = col.getName();
							String colVal = data.getString(colName);
							printTabs(indentation+1);
							writer.print("<"+colName+">"+colVal);
							writer.println("</"+colName+">");
						}
					}
				}
				printTabs(indentation);
				writer.println("</"+table2+">");
			}
		}catch(Exception ex){
			throw new MainException(ex.getMessage());
		}
	}