public String toXml() {
	
		calcMashSchedule();
		StringBuffer sb = new StringBuffer();
		sb.append("  <MASH>\n");
		sb.append(SBStringUtils.xmlElement("NAME", name, 4));
		sb.append(SBStringUtils.xmlElement("MASH_VOLUME", SBStringUtils.format(Quantity.convertUnit("qt", volUnits, volQts), 2) , 4));
		sb.append(SBStringUtils.xmlElement("MASH_VOL_U", "" + volUnits, 4));
		sb.append(SBStringUtils.xmlElement("MASH_RATIO", "" + mashRatio, 4));
		sb.append(SBStringUtils.xmlElement("MASH_RATIO_U", "" + mashRatioU, 4));
		sb.append(SBStringUtils.xmlElement("MASH_TIME", "" + totalTime, 4));
		sb.append(SBStringUtils.xmlElement("MASH_TMP_U", "" + tempUnits, 4));
		sb.append(SBStringUtils.xmlElement("THICK_DECOCT_RATIO", "" + thickDecoctRatio, 4));
		sb.append(SBStringUtils.xmlElement("THIN_DECOCT_RATIO", "" + thinDecoctRatio, 4));		
		if (tempUnits.equals("C")){
			sb.append(SBStringUtils.xmlElement("MASH_TUNLOSS_TEMP", "" + (tunLossF/1.8), 4));
			sb.append(SBStringUtils.xmlElement("GRAIN_TEMP", "" + BrewCalcs.fToC(grainTempF), 4));
			sb.append(SBStringUtils.xmlElement("BOIL_TEMP", "" + BrewCalcs.fToC(boilTempF), 4));
		}
		else {			
			sb.append(SBStringUtils.xmlElement("MASH_TUNLOSS_TEMP", "" + tunLossF, 4));
			sb.append(SBStringUtils.xmlElement("GRAIN_TEMP", "" + grainTempF, 4));
			sb.append(SBStringUtils.xmlElement("BOIL_TEMP", "" + boilTempF, 4));
		}
		for (int i = 0; i < steps.size(); i++) {
			MashStep st = (MashStep) steps.get(i);
			sb.append("    <ITEM>\n");
			sb.append("      <TYPE>" + st.type + "</TYPE>\n");
			sb.append("      <TEMP>" + st.startTemp + "</TEMP>\n");
			if (tempUnits.equals("C"))
				sb.append("      <DISPL_TEMP>" + SBStringUtils.format(BrewCalcs.fToC(st.startTemp), 1) + "</DISPL_TEMP>\n");
			else
				sb.append("      <DISPL_TEMP>" + st.startTemp + "</DISPL_TEMP>\n");
			sb.append("      <END_TEMP>" + st.endTemp + "</END_TEMP>\n");
			if (tempUnits.equals("C"))
				sb.append("      <DISPL_END_TEMP>" + SBStringUtils.format(BrewCalcs.fToC(st.endTemp), 1) + "</DISPL_END_TEMP>\n");
			else
				sb.append("      <DISPL_END_TEMP>" + st.endTemp + "</DISPL_END_TEMP>\n");
			sb.append("      <MIN>" + st.minutes + "</MIN>\n");
			sb.append("      <RAMP_MIN>" + st.rampMin + "</RAMP_MIN>\n");
			sb.append("      <METHOD>" + st.method + "</METHOD>\n");
			sb.append("      <WEIGHT_LBS>"	+ st.weightLbs + "</WEIGHT_LBS>\n");
			sb.append("      <DIRECTIONS>" + st.directions + "</DIRECTIONS>\n");
			sb.append("    </ITEM>\n");
		}

		sb.append("  </MASH>\n");
		return sb.toString();
	}