public static Node objectToNode(Document doc, Object param){
		Node valEl = doc.createElement("value");
		if(param instanceof Map){ //Reverse of the parseVal() struct-to-HashMap code
			Element structEl = doc.createElement("struct");
			for(Object entryObj : ((Map)param).entrySet()){
				Map.Entry ent = (Map.Entry)entryObj;
				Element membEl = doc.createElement("member");
				Element nameEl = doc.createElement("name");
				nameEl.appendChild(doc.createTextNode(ent.getKey().toString()));
				membEl.appendChild(nameEl);
				membEl.appendChild(objectToNode(doc,ent.getValue()));
				structEl.appendChild(membEl);
			}
			valEl.appendChild(structEl);
		}else if(param instanceof List || param instanceof Object[]){ //Reverse of the parseVal() array-to-HashMap code
			Element arrayEl = doc.createElement("array");
			Element dataEl = doc.createElement("data");
			if(param instanceof Object[])
				for(Object obj : (Object[])param)
					dataEl.appendChild(objectToNode(doc,obj));
			else
				for(Object obj : (List)param)
					dataEl.appendChild(objectToNode(doc,obj));
			arrayEl.appendChild(dataEl);
			valEl.appendChild(arrayEl);
		}else if(param instanceof Integer){ //not sure I even need this
			Element i4El = doc.createElement("i4");
			i4El.appendChild(doc.createTextNode(param.toString()));
			valEl.appendChild(i4El);
		}else if(param instanceof Boolean){ //not sure I even need this
			Element boolEl = doc.createElement("boolean");
			boolEl.appendChild(doc.createTextNode(param.toString()));
			valEl.appendChild(boolEl);
		}else{
			Element strEl = doc.createElement("string");
			strEl.appendChild(doc.createTextNode(param.toString()));
			valEl.appendChild(strEl);
		}
		return valEl;
	}