diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs
index d8c24ba..97f3b6f 100644
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,15 @@
-#Thu Jun 11 01:36:27 GMT 2009
+#Sat Jan 02 18:55:59 GMT-05:00 2010
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.doc.comment.support=enabled
 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
 org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -13,7 +18,7 @@
 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -79,4 +84,4 @@
 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java
index 198f999..dd5a08e 100644
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java
+++ b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java
@@ -24,11 +24,13 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.URIResolver;
 
 import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.ConfigurationException;
 import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.CreationException;
@@ -40,17 +42,18 @@
 /**
  * The definition of the transformation pipeline.
  * <p>
- * This class is loaded on both the Eclipse classpath and the transformation process's classpath.
- * The whole definition is serialized to an XML document by the Eclipse launcher, and is then 
- * read by the transformation process when launched.
+ * This class is loaded on both the Eclipse classpath and the transformation
+ * process's classpath. The whole definition is serialized to an XML document by
+ * the Eclipse launcher, and is then read by the transformation process when
+ * launched.
  * </p>
  * 
  * @author Doug Satchwell
  */
-public class PipelineDefinition
-{
+public class PipelineDefinition {
 	private String sourceURL;
 	private String targetFile;
+
 	private final List transformDefs = new ArrayList();
 	private final Set attributes = new HashSet();
 	private boolean useEmbedded;
@@ -58,36 +61,40 @@
 	/**
 	 * Create a new empty instance of this.
 	 */
-	public PipelineDefinition()
-	{
+	public PipelineDefinition() {
 	}
 
 	/**
 	 * Create a new instance of this by reading the specified XML file.
 	 * 
-	 * @param launchFile the XSL file to load
-	 * @throws SAXException if problems occur during parsing
-	 * @throws IOException if problems occur during parsing
-	 * @throws ParserConfigurationException if problems occur during parsing
+	 * @param launchFile
+	 *            the XSL file to load
+	 * @throws SAXException
+	 *             if problems occur during parsing
+	 * @throws IOException
+	 *             if problems occur during parsing
+	 * @throws ParserConfigurationException
+	 *             if problems occur during parsing
 	 */
-	public PipelineDefinition(File launchFile) throws SAXException, IOException, ParserConfigurationException
-	{
-		this(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new BufferedInputStream(new FileInputStream(launchFile))));
+	public PipelineDefinition(File launchFile) throws SAXException,
+			IOException, ParserConfigurationException {
+		this(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
+				new BufferedInputStream(new FileInputStream(launchFile))));
 	}
 
 	/**
 	 * Create a new instance of this from the specified document
 	 * 
-	 * @param doc the Document to create this from
+	 * @param doc
+	 *            the Document to create this from
 	 */
-	public PipelineDefinition(Document doc)
-	{
+	public PipelineDefinition(Document doc) {
 		Element rootEl = doc.getDocumentElement();
 
-		Element attributesEl = (Element) rootEl.getElementsByTagName("Attributes").item(0); //$NON-NLS-1$
+		Element attributesEl = (Element) rootEl.getElementsByTagName(
+				"Attributes").item(0); //$NON-NLS-1$
 		NodeList attributeEls = attributesEl.getElementsByTagName("Attribute"); //$NON-NLS-1$
-		for (int i = 0; i < attributeEls.getLength(); i++)
-		{
+		for (int i = 0; i < attributeEls.getLength(); i++) {
 			Element attributeEl = (Element) attributeEls.item(i);
 			String name = attributeEl.getAttribute("name"); //$NON-NLS-1$
 			String type = attributeEl.getAttribute("type"); //$NON-NLS-1$
@@ -95,17 +102,18 @@
 			addAttribute(new TypedValue(name, type, value));
 		}
 
-		Element transformsEl = (Element) rootEl.getElementsByTagName("Transforms").item(0); //$NON-NLS-1$
+		Element transformsEl = (Element) rootEl.getElementsByTagName(
+				"Transforms").item(0); //$NON-NLS-1$
 		String useEmbedded = transformsEl.getAttribute("useEmbedded"); //$NON-NLS-1$
 		boolean embedded = Boolean.getBoolean(useEmbedded);
 		setUseEmbedded(embedded);
-		if (!embedded)
-		{
-			NodeList transformEls = transformsEl.getElementsByTagName("Transform"); //$NON-NLS-1$
-			for (int i = 0; i < transformEls.getLength(); i++)
-			{
+		if (!embedded) {
+			NodeList transformEls = transformsEl
+					.getElementsByTagName("Transform"); //$NON-NLS-1$
+			for (int i = 0; i < transformEls.getLength(); i++) {
 				Element transformEl = (Element) transformEls.item(i);
-				TransformDefinition tdef = TransformDefinition.fromXML(transformEl);
+				TransformDefinition tdef = TransformDefinition
+						.fromXML(transformEl);
 				addTransformDef(tdef);
 			}
 		}
@@ -114,57 +122,66 @@
 	/**
 	 * Configure the invoker from this.
 	 * 
-	 * @param invoker the invoker to configure
-	 * @throws ConfigurationException if an exception occurs during configuration
+	 * @param invoker
+	 *            the invoker to configure
+	 * @throws ConfigurationException
+	 *             if an exception occurs during configuration
 	 */
-	public void configure(IProcessorInvoker invoker) throws ConfigurationException
-	{
-		Map attVals = new HashMap();
-		for (Iterator iter = attributes.iterator(); iter.hasNext();)
-		{
+	public void configure(IProcessorInvoker invoker)
+			throws ConfigurationException {
+		Map attVals = new ConcurrentHashMap();
+		for (Iterator iter = attributes.iterator(); iter.hasNext();) {
 			TypedValue att = (TypedValue) iter.next();
 			Object value;
-			try
-			{
+			try {
 				value = att.createValue();
-			}
-			catch (CreationException e)
-			{
+			} catch (CreationException e) {
 				throw new ConfigurationException(e.getMessage(), e);
 			}
-			attVals.put(att.uri, value);
+			attVals.put(att.name, value);
 		}
 		invoker.setAttributes(attVals);
 
-		for (Iterator iter = transformDefs.iterator(); iter.hasNext();)
-		{
+		for (Iterator iter = transformDefs.iterator(); iter.hasNext();) {
 			TransformDefinition tdef = (TransformDefinition) iter.next();
 			Map params = null;
-			try
-			{
+			try {
 				params = tdef.getParametersAsMap();
-			}
-			catch (CreationException e)
-			{
-				throw new ConfigurationException(Messages.getString("PipelineDefinition.8"), e); //$NON-NLS-1$
+			} catch (CreationException e) {
+				throw new ConfigurationException(Messages
+						.getString("PipelineDefinition.8"), e); //$NON-NLS-1$
 			}
 			URL url = null;
-			try
-			{
+			try {
 				url = new URL(tdef.getStylesheetURL());
-			}
-			catch (MalformedURLException e)
-			{
-				throw new ConfigurationException(Messages.getString("PipelineDefinition.9") + tdef.getStylesheetURL(), e); //$NON-NLS-1$
+			} catch (MalformedURLException e) {
+				throw new ConfigurationException(
+						Messages.getString("PipelineDefinition.9") + tdef.getStylesheetURL(), e); //$NON-NLS-1$
 			}
 			Properties properties = tdef.getOutputProperties();
-			try
-			{
-				invoker.addStylesheet(url, params, properties, null);
-			}
-			catch (TransformerConfigurationException e)
-			{
-				throw new ConfigurationException(Messages.getString("PipelineDefinition.10") + tdef.getStylesheetURL(), null); //$NON-NLS-1$
+			URIResolver resolver = null;
+
+//			if (tdef.getResolverClass() != null) {
+//				try {
+//					resolver = (URIResolver) Class.forName(
+//							tdef.getResolverClass()).newInstance();
+//				} catch (InstantiationException e) {
+//					throw new ConfigurationException(
+//							Messages.getString("PipelineDefinition.10") + tdef.getResolverClass(), null); //$NON-NLS-1$
+//				} catch (IllegalAccessException e) {
+//					throw new ConfigurationException(
+//							Messages.getString("PipelineDefinition.10") + tdef.getResolverClass(), null); //$NON-NLS-1$
+//				} catch (ClassNotFoundException e) {
+//					throw new ConfigurationException(
+//							Messages.getString("PipelineDefinition.10") + tdef.getResolverClass(), null); //$NON-NLS-1$
+//				}
+//			}
+
+			try {
+				invoker.addStylesheet(url, params, properties, resolver);
+			} catch (TransformerConfigurationException e) {
+				throw new ConfigurationException(
+						Messages.getString("PipelineDefinition.10") + tdef.getStylesheetURL(), null); //$NON-NLS-1$
 			}
 		}
 	}
@@ -174,28 +191,27 @@
 	 * 
 	 * @return the set of attributes
 	 */
-	public Set getAttributes()
-	{
+	public Set getAttributes() {
 		return attributes;
 	}
 
 	/**
 	 * Add a attribute to this configuration
 	 * 
-	 * @param attribute the attribute to add
+	 * @param attribute
+	 *            the attribute to add
 	 */
-	public void addAttribute(TypedValue attribute)
-	{
+	public void addAttribute(TypedValue attribute) {
 		attributes.add(attribute);
 	}
 
 	/**
 	 * Remove a attribute from the set of attributes
 	 * 
-	 * @param attribute the attribute to remove
+	 * @param attribute
+	 *            the attribute to remove
 	 */
-	public void removeAttribute(TypedValue attribute)
-	{
+	public void removeAttribute(TypedValue attribute) {
 		attributes.remove(attribute);
 	}
 
@@ -204,48 +220,46 @@
 	 * 
 	 * @return the list of transform definitions
 	 */
-	public List getTransformDefs()
-	{
+	public List getTransformDefs() {
 		return transformDefs;
 	}
 
 	/**
 	 * Add a transform definition to this.
 	 * 
-	 * @param tdef the transform definition to add
+	 * @param tdef
+	 *            the transform definition to add
 	 */
-	public void addTransformDef(TransformDefinition tdef)
-	{
+	public void addTransformDef(TransformDefinition tdef) {
 		transformDefs.add(tdef);
 	}
 
 	/**
 	 * Remove a transform definition from this.
 	 * 
-	 * @param tdef the transform definition to remove
+	 * @param tdef
+	 *            the transform definition to remove
 	 */
-	public void removeTransformDef(TransformDefinition tdef)
-	{
+	public void removeTransformDef(TransformDefinition tdef) {
 		transformDefs.remove(tdef);
 	}
 
 	/**
-	 * Set whether to use an XSL declaration embedded in the XML file 
+	 * Set whether to use an XSL declaration embedded in the XML file
 	 * 
-	 * @param embedded true to use embedded
+	 * @param embedded
+	 *            true to use embedded
 	 */
-	public void setUseEmbedded(boolean embedded)
-	{
+	public void setUseEmbedded(boolean embedded) {
 		useEmbedded = embedded;
 	}
 
 	/**
-	 * Get whether to use an XSL declaration embedded in the XML file 
+	 * Get whether to use an XSL declaration embedded in the XML file
 	 * 
 	 * @return true if embedded
 	 */
-	public boolean useEmbedded()
-	{
+	public boolean useEmbedded() {
 		return useEmbedded;
 	}
 
@@ -253,10 +267,10 @@
 	 * Serialize this to a DOM Document.
 	 * 
 	 * @return the serialized document
-	 * @throws ParserConfigurationException if a problem occurs during serialization
+	 * @throws ParserConfigurationException
+	 *             if a problem occurs during serialization
 	 */
-	public Document toXML() throws ParserConfigurationException
-	{
+	public Document toXML() throws ParserConfigurationException {
 		Document doc = newDocument();
 		Element rootEl = doc.createElement("Pipeline"); //$NON-NLS-1$
 		rootEl.setAttribute("source", sourceURL); //$NON-NLS-1$
@@ -265,23 +279,20 @@
 
 		Element attributesEl = doc.createElement("Attributes"); //$NON-NLS-1$
 		rootEl.appendChild(attributesEl);
-		for (Iterator iter = attributes.iterator(); iter.hasNext();)
-		{
+		for (Iterator iter = attributes.iterator(); iter.hasNext();) {
 			TypedValue attribute = (TypedValue) iter.next();
 			Element attributeEl = doc.createElement("Attribute"); //$NON-NLS-1$
-			attributeEl.setAttribute("name", attribute.uri); //$NON-NLS-1$
+			attributeEl.setAttribute("name", attribute.name); //$NON-NLS-1$
 			attributeEl.setAttribute("type", attribute.type); //$NON-NLS-1$
 			attributeEl.setAttribute("value", attribute.value); //$NON-NLS-1$
 			attributesEl.appendChild(attributeEl);
 		}
 
 		rootEl.setAttribute("useEmbedded", String.valueOf(useEmbedded)); //$NON-NLS-1$
-		if (!useEmbedded)
-		{
+		if (!useEmbedded) {
 			Element transformsEl = doc.createElement("Transforms"); //$NON-NLS-1$
 			rootEl.appendChild(transformsEl);
-			for (Iterator iter = transformDefs.iterator(); iter.hasNext();)
-			{
+			for (Iterator iter = transformDefs.iterator(); iter.hasNext();) {
 				TransformDefinition tdef = (TransformDefinition) iter.next();
 				Element tdefEl = tdef.asXML(doc);
 				transformsEl.appendChild(tdefEl);
@@ -291,8 +302,7 @@
 		return doc;
 	}
 
-	private static Document newDocument() throws ParserConfigurationException
-	{
+	private static Document newDocument() throws ParserConfigurationException {
 		DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
 		DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
 		Document doc = docBuilder.newDocument();
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java
index 8679d90..f51c8bd 100644
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java
+++ b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java
@@ -10,12 +10,12 @@
  *******************************************************************************/
 package org.eclipse.wst.xsl.jaxp.debug.invoker;
 
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.CreationException;
 import org.w3c.dom.Document;
@@ -27,26 +27,30 @@
  * 
  * @author Doug Satchwell
  */
-public class TransformDefinition
-{
+public class TransformDefinition {
+	public static final String DEFAULT_CATALOG_RESOLVER = "org.apache.xml.resolver.tools.CatalogResolver"; //$NON-NLS-1$
 	private String stylesheetURL;
 	private String resolverClass;
 	private Properties outputProperties = new Properties();
-	private final Set parameters = new HashSet();
+	private final Set<TypedValue> parameters = new HashSet<TypedValue>();
+	
+	public TransformDefinition() {
+		this.resolverClass = DEFAULT_CATALOG_RESOLVER;
+	}
 
 	/**
-	 * Get the parameters as a map of name (<code>String</code>) v. value <code>TypedValue</code>.
+	 * Get the parameters as a map of name (<code>String</code>) v. value
+	 * <code>TypedValue</code>.
 	 * 
 	 * @return a map of names and values
-	 * @throws CreationException if an exception occurred during object creation
+	 * @throws CreationException
+	 *             if an exception occurred during object creation
 	 */
-	public Map getParametersAsMap() throws CreationException
-	{
-		Map m = new HashMap();
-		for (Iterator iter = parameters.iterator(); iter.hasNext();)
-		{
-			TypedValue tv = (TypedValue) iter.next();
-			String key = tv.uri;
+	public Map<String, Object> getParametersAsMap() throws CreationException {
+		Map<String, Object> m = new ConcurrentHashMap<String, Object>();
+		for (Iterator<TypedValue> iter = parameters.iterator(); iter.hasNext();) {
+			TypedValue tv = iter.next();
+			String key = tv.name;
 			Object value = tv.createValue();
 			m.put(key, value);
 		}
@@ -58,28 +62,27 @@
 	 * 
 	 * @return a set of <code>TypedValue</code>'s
 	 */
-	public Set getParameters()
-	{
+	public Set<TypedValue> getParameters() {
 		return parameters;
 	}
 
 	/**
 	 * Add a parameter to the set of parameters
 	 * 
-	 * @param parameter the parameter to add
+	 * @param parameter
+	 *            the parameter to add
 	 */
-	public void addParameter(TypedValue parameter)
-	{
+	public void addParameter(TypedValue parameter) {
 		parameters.add(parameter);
 	}
 
 	/**
 	 * Remove a parameter.
 	 * 
-	 * @param parameter the parameter to remove
+	 * @param parameter
+	 *            the parameter to remove
 	 */
-	public void removeParameter(TypedValue parameter)
-	{
+	public void removeParameter(TypedValue parameter) {
 		parameters.remove(parameter);
 	}
 
@@ -88,39 +91,40 @@
 	 * 
 	 * @return the output properties
 	 */
-	public Properties getOutputProperties()
-	{
+	public Properties getOutputProperties() {
 		return outputProperties;
 	}
 
 	/**
 	 * Set the output properties for this.
 	 * 
-	 * @param outputProperties the output properties to set
+	 * @param outputProperties
+	 *            the output properties to set
 	 */
-	public void setOutputProperties(Properties outputProperties)
-	{
+	public void setOutputProperties(Properties outputProperties) {
 		this.outputProperties = outputProperties;
 	}
 
 	/**
-	 * Set the value of a specific output property.
+	 * Set the value of a specific output property.  If the property
+	 * does not already exist, it will be created.
 	 * 
-	 * @param name the output property
-	 * @param value the value
+	 * @param name
+	 *            the output property
+	 * @param value
+	 *            the value
 	 */
-	public void setOutputProperty(String name, String value)
-	{
+	public void setOutputProperty(String name, String value) {
 		outputProperties.put(name, value);
 	}
 
 	/**
 	 * Remove an output property.
 	 * 
-	 * @param name the output property to remove
+	 * @param name
+	 *            the output property to remove
 	 */
-	public void removeOutputProperty(String name)
-	{
+	public void removeOutputProperty(String name) {
 		outputProperties.remove(name);
 	}
 
@@ -129,18 +133,17 @@
 	 * 
 	 * @return the resolver's class name
 	 */
-	public String getResolverClass()
-	{
+	public String getResolverClass() {
 		return resolverClass;
 	}
 
 	/**
 	 * Set the name of the <code>URIResolver</code> class to use.
 	 * 
-	 *  @param resolver the resolver's class name
+	 * @param resolver
+	 *            the resolver's class name
 	 */
-	public void setResolverClass(String resolver)
-	{
+	public void setResolverClass(String resolver) {
 		resolverClass = resolver;
 	}
 
@@ -149,38 +152,38 @@
 	 * 
 	 * @return the stylesheet URL
 	 */
-	public String getStylesheetURL()
-	{
+	public String getStylesheetURL() {
 		return stylesheetURL;
 	}
 
 	/**
 	 * Set the URL of the stylesheet.
 	 * 
-	 * @param stylesheet the stylesheet URL
+	 * @param stylesheet
+	 *            the stylesheet URL
 	 */
-	public void setStylesheetURL(String stylesheet)
-	{
+	public void setStylesheetURL(String stylesheet) {
 		stylesheetURL = stylesheet;
 	}
 
 	/**
 	 * Serialize this to a Document fragment.
 	 * 
-	 * @param doc the document to attach to
+	 * @param doc
+	 *            the document to attach to
 	 * @return the root element of the fragment
 	 */
-	public Element asXML(Document doc)
-	{
+	public Element asXML(Document doc) {
 		Element tdefEl = doc.createElement("Transform"); //$NON-NLS-1$
-		tdefEl.setAttribute(Messages.getString("TransformDefinition.1"), stylesheetURL); //$NON-NLS-1$
+		tdefEl.setAttribute(
+				Messages.getString("TransformDefinition.1"), stylesheetURL); //$NON-NLS-1$
 		if (resolverClass != null)
 			tdefEl.setAttribute("uriResolver", resolverClass); //$NON-NLS-1$
 		Element opEl = doc.createElement("OutputProperties"); //$NON-NLS-1$
 		tdefEl.appendChild(opEl);
-		for (Iterator iter = outputProperties.entrySet().iterator(); iter.hasNext();)
-		{
-			Map.Entry entry = (Map.Entry) iter.next();
+		for (Iterator<?> iter = outputProperties.entrySet().iterator(); iter
+				.hasNext();) {
+			Map.Entry<?, ?> entry = (Map.Entry<?, ?>) iter.next();
 			Element propEl = doc.createElement("Property"); //$NON-NLS-1$
 			propEl.setAttribute("name", (String) entry.getKey()); //$NON-NLS-1$
 			propEl.setAttribute("value", (String) entry.getValue()); //$NON-NLS-1$
@@ -188,11 +191,10 @@
 		}
 		Element paramsEl = doc.createElement("Parameters"); //$NON-NLS-1$
 		tdefEl.appendChild(paramsEl);
-		for (Iterator iter = parameters.iterator(); iter.hasNext();)
-		{
+		for (Iterator<TypedValue> iter = parameters.iterator(); iter.hasNext();) {
 			Element propEl = doc.createElement("Parameter"); //$NON-NLS-1$
-			TypedValue param = (TypedValue) iter.next();
-			propEl.setAttribute("name", param.uri); //$NON-NLS-1$
+			TypedValue param = iter.next();
+			propEl.setAttribute("name", param.name); //$NON-NLS-1$
 			propEl.setAttribute("type", param.type); //$NON-NLS-1$
 			propEl.setAttribute("value", param.value); //$NON-NLS-1$
 			paramsEl.appendChild(propEl);
@@ -203,23 +205,22 @@
 	/**
 	 * Create a new instance of this from its serialized form.
 	 * 
-	 * @param transformEl the element to create this from
+	 * @param transformEl
+	 *            the element to create this from
 	 * @return a new instance of this
 	 */
-	public static TransformDefinition fromXML(Element transformEl)
-	{
+	public static TransformDefinition fromXML(Element transformEl) {
 		TransformDefinition tdef = new TransformDefinition();
 		String url = transformEl.getAttribute("url"); //$NON-NLS-1$
 		tdef.setStylesheetURL(url);
 		String uriResolver = transformEl.getAttribute("uriResolver"); //$NON-NLS-1$
 		tdef.setResolverClass(uriResolver);
 
-		Element opEl = (Element) transformEl.getElementsByTagName("OutputProperties").item(0); //$NON-NLS-1$
-		if (opEl != null)
-		{
+		Element opEl = (Element) transformEl.getElementsByTagName(
+				"OutputProperties").item(0); //$NON-NLS-1$
+		if (opEl != null) {
 			NodeList propEls = opEl.getElementsByTagName("Property"); //$NON-NLS-1$
-			for (int i = 0; i < propEls.getLength(); i++)
-			{
+			for (int i = 0; i < propEls.getLength(); i++) {
 				Element propEl = (Element) propEls.item(i);
 				String name = propEl.getAttribute("name"); //$NON-NLS-1$
 				String value = propEl.getAttribute("value"); //$NON-NLS-1$
@@ -227,16 +228,19 @@
 			}
 		}
 
-		Element paramsEl = (Element) transformEl.getElementsByTagName(Messages.getString("TransformDefinition.18")).item(0); //$NON-NLS-1$
-		if (paramsEl != null)
-		{
-			NodeList paramEls = paramsEl.getElementsByTagName(Messages.getString("TransformDefinition.19")); //$NON-NLS-1$
-			for (int i = 0; i < paramEls.getLength(); i++)
-			{
+		Element paramsEl = (Element) transformEl.getElementsByTagName(
+				Messages.getString("TransformDefinition.18")).item(0); //$NON-NLS-1$
+		if (paramsEl != null) {
+			NodeList paramEls = paramsEl.getElementsByTagName(Messages
+					.getString("TransformDefinition.19")); //$NON-NLS-1$
+			for (int i = 0; i < paramEls.getLength(); i++) {
 				Element paramEl = (Element) paramEls.item(i);
-				String name = paramEl.getAttribute(Messages.getString("TransformDefinition.20")); //$NON-NLS-1$
-				String type = paramEl.getAttribute(Messages.getString("TransformDefinition.21")); //$NON-NLS-1$
-				String value = paramEl.getAttribute(Messages.getString("TransformDefinition.22")); //$NON-NLS-1$
+				String name = paramEl.getAttribute(Messages
+						.getString("TransformDefinition.20")); //$NON-NLS-1$
+				String type = paramEl.getAttribute(Messages
+						.getString("TransformDefinition.21")); //$NON-NLS-1$
+				String value = paramEl.getAttribute(Messages
+						.getString("TransformDefinition.22")); //$NON-NLS-1$
 				tdef.addParameter(new TypedValue(name, type, value));
 			}
 		}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java
index ad51c4d..e0eea0e 100644
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java
+++ b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java
@@ -13,123 +13,99 @@
 import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.CreationException;
 
 /**
- * A value that is to be instantiated from a particular type e.g. Double, Object.
+ * A value that is to be instantiated from a particular type e.g. Double,
+ * Object.
  * 
  * @author Doug Satchwell
  */
-public class TypedValue
-{
+public class TypedValue {
 	public static final String TYPE_STRING = "string"; //$NON-NLS-1$
-	private static final String TYPE_BOOLEAN = "boolean"; //$NON-NLS-1$
-	private static final String TYPE_INT = "int"; //$NON-NLS-1$
-	private static final String TYPE_DOUBLE = "double"; //$NON-NLS-1$
-	private static final String TYPE_FLOAT = "float"; //$NON-NLS-1$
-	private static final String TYPE_CLASS = "class"; //$NON-NLS-1$
-	private static final String TYPE_OBJECT = "object"; //$NON-NLS-1$
+	public static final String TYPE_BOOLEAN = "boolean"; //$NON-NLS-1$
+	public static final String TYPE_INT = "int"; //$NON-NLS-1$
+	public static final String TYPE_DOUBLE = "double"; //$NON-NLS-1$
+	public static final String TYPE_FLOAT = "float"; //$NON-NLS-1$
+	public static final String TYPE_CLASS = "class"; //$NON-NLS-1$
+	public static final String TYPE_OBJECT = "object"; //$NON-NLS-1$
 
-	final String uri;
+	final String name;
 	final String type;
 	final String value;
 
 	/**
-	 * Create a new instance of this from the given information. 
+	 * Create a new instance of this from the given information.
 	 * 
-	 * @param uri the URI
-	 * @param type the type of value
-	 * @param value the value
+	 * @param name
+	 *            the parameter name
+	 * @param type
+	 *            the type of value
+	 * @param value
+	 *            the value
 	 */
-	public TypedValue(String uri, String type, String value)
-	{
-		this.uri = uri;
+	public TypedValue(String name, String type, String value) {
+		this.name = name;
 		this.type = type;
 		this.value = value;
 	}
 
 	/**
-	 * Create the type of object defined by this. 
+	 * Create the type of object defined by this.
 	 * 
 	 * @return the value
-	 * @throws CreationException if a problem occurred
+	 * @throws CreationException
+	 *             if a problem occurred
 	 */
-	public Object createValue() throws CreationException
-	{
+	public Object createValue() throws CreationException {
 		Object o = null;
-		if (TYPE_STRING.equals(type))
-		{
+		if (TYPE_STRING.equals(type)) {
 			o = value;
-		}
-		else if (TYPE_BOOLEAN.equals(type))
-		{
+		} else if (TYPE_BOOLEAN.equals(type)) {
 			boolean b = "yes".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value); //$NON-NLS-1$ //$NON-NLS-2$
 			o = new Boolean(b);
-		}
-		else if (TYPE_INT.equals(type))
-		{
-			try
-			{
+		} else if (TYPE_INT.equals(type)) {
+			try {
 				o = new Integer(value);
+			} catch (NumberFormatException e) {
+				throw new CreationException(
+						Messages.getString("TypedValue.9") + value + Messages.getString("TypedValue.10"), e); //$NON-NLS-1$ //$NON-NLS-2$
 			}
-			catch (NumberFormatException e)
-			{
-				throw new CreationException(Messages.getString("TypedValue.9") + value + Messages.getString("TypedValue.10"), e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		else if (TYPE_DOUBLE.equals(type))
-		{
-			try
-			{
+		} else if (TYPE_DOUBLE.equals(type)) {
+			try {
 				o = new Double(value);
+			} catch (NumberFormatException e) {
+				throw new CreationException(
+						Messages.getString("TypedValue.11") + value + Messages.getString("TypedValue.12"), e); //$NON-NLS-1$ //$NON-NLS-2$
 			}
-			catch (NumberFormatException e)
-			{
-				throw new CreationException(Messages.getString("TypedValue.11") + value + Messages.getString("TypedValue.12"), e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		else if (TYPE_FLOAT.equals(type))
-		{
-			try
-			{
+		} else if (TYPE_FLOAT.equals(type)) {
+			try {
 				o = new Float(value);
+			} catch (NumberFormatException e) {
+				throw new CreationException(
+						Messages.getString("TypedValue.13") + value + Messages.getString("TypedValue.14"), e); //$NON-NLS-1$ //$NON-NLS-2$
 			}
-			catch (NumberFormatException e)
-			{
-				throw new CreationException(Messages.getString("TypedValue.13") + value + Messages.getString("TypedValue.14"), e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		else if (TYPE_CLASS.equals(type))
-		{
-			try
-			{
+		} else if (TYPE_CLASS.equals(type)) {
+			try {
 				o = Class.forName(value);
+			} catch (ClassNotFoundException e) {
+				throw new CreationException(
+						Messages.getString("TypedValue.15") + value + Messages.getString("TypedValue.16"), e); //$NON-NLS-1$ //$NON-NLS-2$
 			}
-			catch (ClassNotFoundException e)
-			{
-				throw new CreationException(Messages.getString("TypedValue.15") + value + Messages.getString("TypedValue.16"), e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		else if (TYPE_OBJECT.equals(type))
-		{
-			try
-			{
+		} else if (TYPE_OBJECT.equals(type)) {
+			try {
 				Class c = Class.forName(value);
 				o = c.newInstance();
+			} catch (ClassNotFoundException e) {
+				throw new CreationException(
+						Messages.getString("TypedValue.17") + value + Messages.getString("TypedValue.18"), e); //$NON-NLS-1$ //$NON-NLS-2$
+			} catch (InstantiationException e) {
+				throw new CreationException(
+						Messages.getString("TypedValue.19") + value + Messages.getString("TypedValue.20"), e); //$NON-NLS-1$ //$NON-NLS-2$
+			} catch (IllegalAccessException e) {
+				throw new CreationException(
+						Messages.getString("TypedValue.21") + value + Messages.getString("TypedValue.22"), e); //$NON-NLS-1$ //$NON-NLS-2$
 			}
-			catch (ClassNotFoundException e)
-			{
-				throw new CreationException(Messages.getString("TypedValue.17") + value + Messages.getString("TypedValue.18"), e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			catch (InstantiationException e)
-			{
-				throw new CreationException(Messages.getString("TypedValue.19") + value + Messages.getString("TypedValue.20"), e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			catch (IllegalAccessException e)
-			{
-				throw new CreationException(Messages.getString("TypedValue.21") + value + Messages.getString("TypedValue.22"), e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		else
-		{
-			throw new CreationException(Messages.getString("TypedValue.23") + type + Messages.getString("TypedValue.24")); //$NON-NLS-1$ //$NON-NLS-2$
+		} else {
+			throw new CreationException(
+					Messages.getString("TypedValue.23") + type + Messages.getString("TypedValue.24")); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		return o;
 	}
