content = null;
	private InputStream createInputStream(String templateID)		throws InvocationTargetException {		Element elementForTemplate = null;		StringBuffer content = null;		String templateContent = null;		String variablesToExpand = null;		ArrayList variableList = null;		String variableToExpand = null;		try {			elementForTemplate =				getFileTemplateDocument().getElementById(templateID);			content = new StringBuffer("");			if (elementForTemplate != null				&& (new Boolean(elementForTemplate.getAttribute("enabled"))					.booleanValue())				&& elementForTemplate.getFirstChild() != null) {				templateContent =					elementForTemplate.getFirstChild().getNodeValue();				if (templateContent != null) {					// assign initial content					content.append(templateContent);					// build list of variables to expand					variablesToExpand =						elementForTemplate.getAttribute("variables");					variableList =						WOLipsUtils.arrayListFromCSV(variablesToExpand);					if (variablesToExpand != null && !variableList.isEmpty()) {						// expand variables						variableToExpand = null;						int index = -1;						for (int i = 0; i < variableList.size(); i++) {							variableToExpand = (String) variableList.get(i);							// replace all occurences of "${" + variableToExpand + "}"							while ((index =								templateContent.indexOf(									"${" + variableToExpand + "}"))								!= -1) {								content.replace(									index,									index + variableToExpand.length() + 3,									expandVariable(variableToExpand));								templateContent = content.toString();							}						}					}				}			}		} finally {			elementForTemplate = null;			content = null;			templateContent = null;			variablesToExpand = null;			variableList = null;			variableToExpand = null;		}		return new ByteArrayInputStream(content.toString().getBytes());	}