This commit was manufactured by cvs2svn to create tag 'R3_3_1'.
diff --git a/bundles/org.eclipse.wst.xml.xpath.core/.settings/.api_filters b/bundles/org.eclipse.wst.xml.xpath.core/.settings/.api_filters
new file mode 100644
index 0000000..f680c3e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath.core/.settings/.api_filters
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.wst.xml.xpath.core" version="2">
+    <resource path="src/org/eclipse/wst/xml/xpath/core/util/NodeListImpl.java" type="org.eclipse.wst.xml.xpath.core.util.NodeListImpl">
+        <filter comment="Removed since it wasn't used externally" id="338722907">
+            <message_arguments>
+                <message_argument value="org.eclipse.wst.xml.xpath.core.util.NodeListImpl"/>
+                <message_argument value="NodeListImpl(ResultSequence)"/>
+            </message_arguments>
+        </filter>
+    </resource>
+</component>
diff --git a/bundles/org.eclipse.wst.xml.xpath.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.xpath.core/META-INF/MANIFEST.MF
index def8ced..8f9c114 100644
--- a/bundles/org.eclipse.wst.xml.xpath.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.xpath.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.xpath.core; singleton:=true
-Bundle-Version: 1.1.100.qualifier
+Bundle-Version: 1.2.1.qualifier
 Bundle-ClassPath: .
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -24,6 +24,6 @@
  org.eclipse.wst.xml.core;bundle-version="[1.1.0,2.0.0)",
  org.eclipse.wst.xsd.core;bundle-version="[1.1.50,2.0.0)",
  org.eclipse.wst.sse.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.xml.xpath2.wtptypes,
+ org.eclipse.wst.xml.xpath2.processor;bundle-version="[2.0.0,3.0.0)",
  org.eclipse.xsd;bundle-version="[2.3.0,3.0.0)"
 Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/XPathCorePlugin.java b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/XPathCorePlugin.java
index d229077..0988cca 100644
--- a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/XPathCorePlugin.java
+++ b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/XPathCorePlugin.java
@@ -11,12 +11,7 @@
 
 package org.eclipse.wst.xml.xpath.core;
 
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.osgi.framework.BundleContext;
 
 /**
diff --git a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/NodeListImpl.java b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/NodeListImpl.java
index 5ed23f2..89155bf 100644
--- a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/NodeListImpl.java
+++ b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/NodeListImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2009, 2011 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,11 +8,12 @@
  * Contributors:
  *     David Carver (STAR) - initial API and implementation
  *     Jesper Steen Moller - bug 313992 - XPath evaluation does not show atomics
+ *     Jesper Steen Moller - bug 343804 - Updated API information
  *******************************************************************************/
 package org.eclipse.wst.xml.xpath.core.util;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Document;
@@ -29,6 +30,9 @@
 
 	ResultSequence rs;
 	
+	/**
+	 * @since 1.2
+	 */
 	public NodeListImpl(ResultSequence result) {
 		rs = result;
 	}
@@ -38,12 +42,12 @@
 	}
 
 	public Node item(int arg0) {
-		final AnyType type = rs.get(arg0);
+		final Item type = rs.item(arg0);
 		if (type instanceof NodeType) {
 			NodeType nodeType = (NodeType) type;
 			return nodeType.node_value();
 		}
-		return createTextNode(type.string_value());
+		return createTextNode(type.getStringValue());
 	}
 
 	private static Node createTextNode(final String value) {
diff --git a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/SimpleXPathEngine.java b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/SimpleXPathEngine.java
new file mode 100644
index 0000000..5bc27b3
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/SimpleXPathEngine.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Jesper Steen Moller and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moller - initial API and implementation
+ *     Jesper Steen Moller - bug 343804 - Updated API information
+ *******************************************************************************/
+package org.eclipse.wst.xml.xpath.core.util;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.xpath.XPathExpressionException;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @since 1.2
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface SimpleXPathEngine {
+	void parse(String expression) throws XPathExpressionException;
+	boolean isValid();
+	NodeList execute(Node contextNode) throws XPathExpressionException;
+	void setNamespaceContext(NamespaceContext namespaceContext);
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XPath20Helper.java b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XPath20Helper.java
index e099816..b1476e7 100644
--- a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XPath20Helper.java
+++ b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XPath20Helper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2009, 2011 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,14 +7,26 @@
  * 
  * Contributors:
  *     David Carver (STAR) - bug 226245 - initial API and implementation
+ *     Jesper Steen Moller - bug 343804 - Updated API information
+ *     Jesper Steen Moller - bug 348737 - Hook up default namespace from context
  *******************************************************************************/
+
 package org.eclipse.wst.xml.xpath.core.util;
 
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
 import javax.xml.xpath.XPathExpressionException;
 
+import org.eclipse.wst.xml.xpath2.api.XPath2Expression;
+import org.eclipse.wst.xml.xpath2.processor.Engine;
 import org.eclipse.wst.xml.xpath2.processor.JFlexCupParser;
+import org.eclipse.wst.xml.xpath2.processor.StaticError;
 import org.eclipse.wst.xml.xpath2.processor.XPathParser;
 import org.eclipse.wst.xml.xpath2.processor.XPathParserException;
+import org.eclipse.wst.xml.xpath2.processor.util.DynamicContextBuilder;
+import org.eclipse.wst.xml.xpath2.processor.util.StaticContextBuilder;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
  * @since 1.0
@@ -32,5 +44,47 @@
 			throw new XPathExpressionException(ex.getMessage());
 		}
 	}
+	/**
+	 * @since 1.2
+	 */
+	public static class XPath2Engine implements SimpleXPathEngine {
+
+		private NamespaceContext namespaceContext;
+		private StaticContextBuilder staticContextBuilder = new StaticContextBuilder() {
+			@Override
+			public NamespaceContext getNamespaceContext() {
+				return namespaceContext;
+			}
+			public String getDefaultNamespace() {
+				return namespaceContext.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
+			};
+		};
+		private XPath2Expression xPathExpression;
+
+		public void parse(String expression) throws XPathExpressionException {
+			xPathExpression = null;
+			try {
+				xPathExpression = new Engine().parseExpression(expression, staticContextBuilder);
+			} catch (StaticError se) {
+				throw new XPathExpressionException(se.getMessage() + " (" + se.code() + ")");
+			}
+		}
+
+		public boolean isValid() {
+			return xPathExpression != null;
+		}
+
+		public NodeList execute(Node contextNode) {
+			DynamicContextBuilder dynContext = new DynamicContextBuilder(staticContextBuilder);
+			 org.eclipse.wst.xml.xpath2.api.ResultSequence rs = xPathExpression.evaluate(dynContext, new Object[] { contextNode });
+			 return new NodeListImpl(rs);
+		}
+
+		public void setNamespaceContext(NamespaceContext namespaceContext) {
+			this.namespaceContext = namespaceContext;
+//			if (namespaceContext != null) {
+//				namespaceContext.dc.add_namespace("xs", "http://www.w3.org/2001/XMLSchema");
+		}
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XSLTXPathHelper.java b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XSLTXPathHelper.java
index 22e35ee..daa4c41 100644
--- a/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XSLTXPathHelper.java
+++ b/bundles/org.eclipse.wst.xml.xpath.core/src/org/eclipse/wst/xml/xpath/core/util/XSLTXPathHelper.java
@@ -19,7 +19,6 @@
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.compiler.FunctionTable;
-import org.apache.xpath.jaxp.JAXPPrefixResolver;
 import org.apache.xpath.objects.XObject;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
diff --git a/bundles/org.eclipse.wst.xml.xpath.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.xpath.ui/META-INF/MANIFEST.MF
index 50a1898..883a742 100644
--- a/bundles/org.eclipse.wst.xml.xpath.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.xpath.ui/META-INF/MANIFEST.MF
@@ -17,7 +17,7 @@
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,2.0.0)",
  org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.ui.forms;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.wst.xml.xpath.core;bundle-version="[1.1.100,2.0.0)",
+ org.eclipse.wst.xml.xpath.core;bundle-version="[1.2.0,2.0.0)",
  org.eclipse.core.resources;bundle-version="3.5.0",
  org.apache.xalan;bundle-version="2.7.1",
  org.eclipse.wst.xml.xpath2.processor;bundle-version="[2.0.0,3.0.0)",
diff --git a/bundles/org.eclipse.wst.xml.xpath.ui/plugin.xml b/bundles/org.eclipse.wst.xml.xpath.ui/plugin.xml
index f8052f5..e3765fb 100644
--- a/bundles/org.eclipse.wst.xml.xpath.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.xml.xpath.ui/plugin.xml
@@ -59,9 +59,6 @@
 
    <extension
          point="org.eclipse.ui.views">
-      <category      
-            name="%xmlCategoryName"
-            id="org.eclipse.wst.xml"/>
     <view
           category="org.eclipse.wst.xml"
           class="org.eclipse.wst.xml.xpath.ui.internal.views.XPathView"
diff --git a/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/XPathUIPlugin.java b/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/XPathUIPlugin.java
index d1821ec..56fee59 100644
--- a/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/XPathUIPlugin.java
+++ b/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/XPathUIPlugin.java
@@ -16,7 +16,6 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.eclipse.core.runtime.CoreException;
@@ -31,7 +30,6 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.osgi.framework.BundleContext;
-import org.w3c.dom.Document;
 
 /**
  * The activator class controls the plug-in life cycle
@@ -166,9 +164,16 @@
 				info.addAll((Collection<NamespaceInfo>) namespaces);
 				namespaceInfo.put(modelID, info);
 				plugin.setNamespaceInfo(namespaceInfo);
+				
+				ensureDefault(namespaceTable, "xs", "http://www.w3.org/2001/XMLSchema");
 			}
 		}
 		return info;
 	}
+
+	private void ensureDefault(NamespaceTable namespaceTable, String prefix,
+			String uri) {
+		if (namespaceTable.getURIForPrefix(prefix) == null) namespaceTable.addNamespaceInfo(prefix, uri, null);
+	}
 	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathComputer.java b/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathComputer.java
index d8bd170..242306f 100644
--- a/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathComputer.java
+++ b/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathComputer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk and others
+ * Copyright (c) 2008-2011 Chase Technology Ltd - http://www.chasetechnology.co.uk and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,14 +9,14 @@
  *     Doug Satchwell (Chase Technology Ltd) - initial API and implementation
  *     David Carver (STAR) - bug 261428 - XPath View not respecting namespaces.
  *     Jesper Steen Moller - bug 313992 - XPath evaluation does not show atomics
+ *     Jesper Steen Moller - bug 323448 - XPath view doesn't show runtime error information well (or at all)
  *******************************************************************************/
 package org.eclipse.wst.xml.xpath.ui.internal.views;
 
 import java.util.List;
 
-import javax.xml.xpath.XPath;
+import javax.xml.namespace.NamespaceContext;
 import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
 import javax.xml.xpath.XPathExpressionException;
 
 import org.apache.xpath.jaxp.XPathFactoryImpl;
@@ -29,24 +29,15 @@
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.xpath.core.XPathCorePlugin;
 import org.eclipse.wst.xml.xpath.core.XPathProcessorPreferences;
 import org.eclipse.wst.xml.xpath.core.util.NodeListImpl;
+import org.eclipse.wst.xml.xpath.core.util.SimpleXPathEngine;
 import org.eclipse.wst.xml.xpath.core.util.XPath20Helper;
 import org.eclipse.wst.xml.xpath.core.util.XPathCoreHelper;
-import org.eclipse.wst.xml.xpath.core.util.XSLTXPathHelper;
 import org.eclipse.wst.xml.xpath.ui.internal.Messages;
 import org.eclipse.wst.xml.xpath.ui.internal.XPathUIPlugin;
-import org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator;
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.Evaluator;
-import org.eclipse.wst.xml.xpath2.processor.JFlexCupParser;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticChecker;
-import org.eclipse.wst.xml.xpath2.processor.StaticNameResolver;
-import org.eclipse.wst.xml.xpath2.processor.XPathParser;
-import org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary;
-import org.eclipse.wst.xml.xpath2.processor.function.XSCtrLibrary;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
 import org.eclipse.wst.xml.xpath2.processor.internal.DefaultResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 import org.w3c.dom.Document;
@@ -90,6 +81,9 @@
 	private String expression;
 	private String text;
 	private NodeList nodeList;
+	
+	private SimpleXPathEngine xpath2Engine;
+	private SimpleXPathEngine xpath1Engine;
 
 	public XPathComputer(XPathView xpathView) {
 		this.xpathView = xpathView;
@@ -117,18 +111,18 @@
 		try {
 			updateExpression();
 		} catch (XPathExpressionException e) {
-
 		}
 	}
 
 	private void updateExpression() throws XPathExpressionException {
 		synchronized (XPATH_LOCK) {
 			if (text != null) {
-				if (xpath20) {
-					XPath20Helper.compile(text);
-				} else {
-					XSLTXPathHelper.compile(text);
-				}
+				SimpleXPathEngine engine = getCurrentEngine();
+				
+				IDOMDocument doc = (node.getNodeType() == Node.DOCUMENT_NODE) ? (IDOMDocument) node : (IDOMDocument) node.getOwnerDocument();
+				updateNamespaces(engine, doc);
+
+				engine.parse(text);
 				this.expression = text;
 			} else {
 				this.expression = null;
@@ -136,6 +130,17 @@
 		}
 	}
 
+	private SimpleXPathEngine getCurrentEngine() {
+		xpath20 = XPathCoreHelper.getPreferences().getBoolean(XPathProcessorPreferences.XPATH_2_0_PROCESSOR, false);
+		if (xpath20) {
+			if (xpath2Engine == null) xpath2Engine = new XPath20Helper.XPath2Engine();
+			return xpath2Engine;
+		} else {
+			if (xpath1Engine == null) xpath1Engine = new XPath10Engine();
+			return xpath1Engine;
+		}
+	}
+	
 	public void setText(String text) throws XPathExpressionException {
 		this.text = text;
 		updateExpression();
@@ -146,17 +151,15 @@
 	}
 
 	public void compute() {
-		final String[] xps = new String[1];
 		synchronized (XPATH_LOCK) {
-			xps[0] = expression;
 		}
 		Job refresh = new Job(Messages.XPathComputer_5) {
 			@Override
 			protected IStatus run(IProgressMonitor monitor) {
-				if (!xps[0].equals(expression)) {
-					return Status.CANCEL_STATUS;
-				}
-				return doCompute(xps[0]);
+//				if (!xps[0].equals(expression)) {
+//					return Status.CANCEL_STATUS;
+//				}
+				return doCompute();
 			}
 		};
 		refresh.setSystem(true);
@@ -166,121 +169,95 @@
 		service.schedule(refresh, UPDATE_DELAY);
 	}
 
-	private IStatus doCompute(String xp) {
-		IStatus status = executeXPath(xp);
+	private IStatus doCompute() {
+		IStatus status = executeXPath();
 
-		xpathView.xpathRecomputed(nodeList);
+		xpathView.xpathRecomputed(nodeList, status);
 		return status;
 	}
 
-	private IStatus executeXPath(String xp) {
+	private IStatus executeXPath() {
 		IStatus status = Status.CANCEL_STATUS;
-		xpath20 = XPathCoreHelper.getPreferences().getBoolean(XPathProcessorPreferences.XPATH_2_0_PROCESSOR, false);
 		try {
-			if ((xp != null) && (node != null)) {
+			if (node != null) {
 				synchronized (XPATH_LOCK) {
 					
-					if (xpath20) {
-						status = evaluateXPath2(xp);
-					} else {
-						status = evaluateXPath(xp);
-					}
+					SimpleXPathEngine engine = getCurrentEngine();
+					if (! engine.isValid()) engine.parse(text);
+					
+					status = evaluateXPath(engine);
 				}
 			}
 		} catch (XPathExpressionException e) {
-			return Status.CANCEL_STATUS;
+			return new Status(IStatus.CANCEL, XPathCorePlugin.PLUGIN_ID, e.getMessage());
 		}
 		return status;
 	}
 
-	protected IStatus evaluateXPath(String xp) throws XPathExpressionException {
-		XPath newXPath = new XPathFactoryImpl().newXPath();
+	protected IStatus evaluateXPath(SimpleXPathEngine engine) throws XPathExpressionException {
 		IDOMDocument doc = null;
 		if (node.getNodeType() == Node.DOCUMENT_NODE) {
 			doc = (IDOMDocument) node;
 		} else {
 			doc = (IDOMDocument) node.getOwnerDocument();
 		}
-		final List<NamespaceInfo> namespaces = XPathUIPlugin.getDefault()
-				.getNamespaceInfo(doc);
-		if (namespaces != null) {
-			newXPath
-					.setNamespaceContext(new DefaultNamespaceContext(namespaces));
-		}
-		XPathExpression xpExp = newXPath.compile(xp);
+		updateNamespaces(engine, doc);
 
 		try {
-			this.nodeList = (NodeList) xpExp.evaluate(node,
-					XPathConstants.NODESET);
-		} catch (XPathExpressionException xee) {
-			if (xee.getCause() != null && xee.getCause().getMessage().indexOf("Can not convert ") >= 0) {
-				try {
-					String value = (String) xpExp.evaluate(node, XPathConstants.STRING);
-					this.nodeList = new NodeListImpl(new DefaultResultSequence(new XSString(value)));
-				} catch (XPathExpressionException xee2) {
-					return Status.CANCEL_STATUS;
-				}
-			} else {
-				return Status.CANCEL_STATUS;
-			}
+			this.nodeList = (NodeList) engine.execute(node);
+			return Status.OK_STATUS;
+		} catch (DynamicError de) {
+			return new Status(IStatus.CANCEL, XPathCorePlugin.PLUGIN_ID, de.getMessage() + " (" + de.code() + ")");
+		} catch (Throwable t) {
+			return new Status(IStatus.ERROR, XPathCorePlugin.PLUGIN_ID, t.getMessage());
 		}
-		return Status.OK_STATUS;
 	}
 
-	protected IStatus evaluateXPath2(String xp) throws XPathExpressionException {
-
-		IDOMDocument doc;
-		if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			doc = (IDOMDocument) node;
-		} else {
-			doc = (IDOMDocument) node.getOwnerDocument();
-		}
-
-		// Initializing the DynamicContext.
-		DynamicContext dc = new DefaultDynamicContext(null, doc);
-		final List<NamespaceInfo> namespaces = XPathUIPlugin.getDefault()
-				.getNamespaceInfo(doc);
-		dc.add_namespace("xs", "http://www.w3.org/2001/XMLSchema");
-
+	private void updateNamespaces(SimpleXPathEngine engine, IDOMDocument doc) {
+		final List<NamespaceInfo> namespaces = XPathUIPlugin.getDefault().getNamespaceInfo(doc);
 		if (namespaces != null) {
-			// Add the defined namespaces
-			for (NamespaceInfo namespaceinfo : namespaces) {
-				dc.add_namespace(namespaceinfo.prefix, namespaceinfo.uri);
-			}
+			engine.setNamespaceContext(new DefaultNamespaceContext(namespaces));
+		} else {
+			engine.setNamespaceContext(null);
 		}
-
-		dc.add_function_library(new FnFunctionLibrary());
-		dc.add_function_library(new XSCtrLibrary());
-		
-		XPathParser xpp = new JFlexCupParser();
-		
-		 try {
-			 // Parses the XPath expression.
-			 org.eclipse.wst.xml.xpath2.processor.ast.XPath xpath = xpp.parse(xp);
-			 
-			 StaticChecker namecheck = new StaticNameResolver(dc);
-			 namecheck.check(xpath);
-			 
-			 // Static Checking the Xpath expression ’Hello World!’ namecheck.check(xp);
-			 /**
-			  * Evaluate the XPath 2.0 expression
- 			  */
-			 
-			 // Initializing the evaluator with DynamicContext and the name
-			 // of the XML document XPexample.xml as parameters.
-			 Evaluator eval = new DefaultEvaluator(dc, doc);
-			 
-			 ResultSequence rs = eval.evaluate(xpath);
-			 
-			 this.nodeList = new NodeListImpl(rs);
-			 
-		 } catch (Exception ex) {
-			 throw new XPathExpressionException(ex);
-		 }
-
-		return Status.OK_STATUS;
 	}
+	
+	public static class XPath10Engine implements SimpleXPathEngine {
 
+		private javax.xml.xpath.XPathExpression goodXPath = null;
+
+		private NamespaceContext namespaceContext;
+
+		public void setNamespaceContext(NamespaceContext namespaceContext) {
+			this.namespaceContext = namespaceContext; 
+		}
+		
+		private javax.xml.xpath.XPath newXPath = new XPathFactoryImpl().newXPath();
+
+		public void parse(String expression) throws XPathExpressionException {
+			goodXPath = null;
+			if (namespaceContext != null) {
+				newXPath.setNamespaceContext(namespaceContext);
+			}
+			goodXPath = newXPath.compile(expression);
+		}			
+
+		public NodeList execute(Node contextNode) throws XPathExpressionException {
+				try {
+					return (NodeList) goodXPath.evaluate(contextNode, XPathConstants.NODESET);
+				} catch (XPathExpressionException xee) {
+					if (xee.getCause() != null && xee.getCause().getMessage().indexOf("Can not convert ") >= 0) {
+						String value = (String) goodXPath.evaluate(contextNode, XPathConstants.STRING);
+						return new NodeListImpl(new DefaultResultSequence(new XSString(value)));
+					} else throw xee;
+				}
+			}
+			
+		public boolean isValid() {
+			return goodXPath != null;
+		}
+	}
+	
 	public void dispose() {
 		if (model != null) {
 			model.removeModelStateListener(modelStateListener);
diff --git a/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathView.java b/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathView.java
index b5b606d..ea455cc 100644
--- a/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathView.java
+++ b/bundles/org.eclipse.wst.xml.xpath.ui/src/org/eclipse/wst/xml/xpath/ui/internal/views/XPathView.java
@@ -19,6 +19,7 @@
 
 import javax.xml.xpath.XPathExpressionException;
 
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.ListenerList;
 import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.jface.action.IAction;
@@ -279,6 +280,7 @@
 		this.location = XSLTXPathHelper.calculateXPathToNode(selected);
 		contextNode = selected;
 		updateLocationText();
+		recomputeXPath();
 	}
 
 	private void recomputeXPath() {
@@ -306,7 +308,7 @@
 		}
 	}
 
-	protected void xpathRecomputed(final NodeList nodeList) {
+	protected void xpathRecomputed(final NodeList nodeList, final IStatus error) {
 		if (getSite() == null) return;
 		Shell shell = getSite().getShell();
 		if (shell == null) return;
@@ -321,6 +323,14 @@
 					treeViewer.setSelection(currentSelection, true);
 					refreshControl.setRedraw(true);
 				}
+				if (error.getSeverity() == IStatus.OK) {
+					expressionValid = true;
+					message = "";
+				} else {
+					expressionValid = false;
+					message = error.getMessage();
+				}
+				updateLocationText();
 			}
 		});
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/.classpath b/bundles/org.eclipse.wst.xml.xpath2.processor/.classpath
index fc8e603..492d1c1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/.classpath
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/.classpath
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry excluding="**/*.lex|**/*.cup" kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
 		<accessrules>
 			<accessrule kind="accessible" pattern="org/eclipse/wst/xml/xpath2/**"/>
 		</accessrules>
 	</classpathentry>
+	<classpathentry excluding="**/*.lex|**/*.cup" kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/.cvsignore b/bundles/org.eclipse.wst.xml.xpath2.processor/.cvsignore
index ccece86..ac075be 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/.cvsignore
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/.cvsignore
@@ -2,3 +2,4 @@
 .externalToolBuilders
 .byecycle
 JavaCUP-dump.txt
+target
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xml.xpath2.processor/.settings/org.eclipse.jdt.core.prefs
index 48a68cd..bd21bd6 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/.settings/org.eclipse.jdt.core.prefs
@@ -1,74 +1,12 @@
-#Tue Feb 10 05:34:51 GMT 2009
+#Sat Mar 12 09:20:38 CET 2011
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=jsr14
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.4
 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.problem.annotationSuperInterface=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
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-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=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
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-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.5
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.xpath2.processor/META-INF/MANIFEST.MF
index f843e41..394f83e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/META-INF/MANIFEST.MF
@@ -16,8 +16,10 @@
  org.eclipse.wst.xml.xpath2.processor.internal.ast;x-internal:=true,
  org.eclipse.wst.xml.xpath2.processor.internal.function;x-internal:=true,
  org.eclipse.wst.xml.xpath2.processor.internal.types;x-internal:=true,
- org.eclipse.wst.xml.xpath2.processor.internal.types.xerces;x-internal:=true,
+ org.eclipse.wst.xml.xpath2.processor.internal.types.builtin;x-internal:=true,
  org.eclipse.wst.xml.xpath2.processor.internal.types.userdefined;x-internal:=true,
- org.eclipse.wst.xml.xpath2.processor.internal.utils;x-internal:=true
+ org.eclipse.wst.xml.xpath2.processor.internal.types.xerces;x-internal:=true,
+ org.eclipse.wst.xml.xpath2.processor.internal.utils;x-internal:=true,
+ org.eclipse.wst.xml.xpath2.processor.util
 Bundle-Vendor: %provider
 Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/build.properties b/bundles/org.eclipse.wst.xml.xpath2.processor/build.properties
index 4dc4023..328c30f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/build.properties
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/build.properties
@@ -7,3 +7,6 @@
 output.. = bin/
 src.includes = about.html,\
                grammars/
+javacSource = 1.5
+javacTarget = jsr14
+javacErrors.. = -enumIdentifier
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/pom.xml b/bundles/org.eclipse.wst.xml.xpath2.processor/pom.xml
index bc68001..dcf541a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/pom.xml
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/pom.xml
@@ -27,6 +27,18 @@
          </plugins>
       </pluginManagement>
       <plugins>
+	      <plugin>
+	        <groupId>org.sonatype.tycho</groupId>
+	        <artifactId>maven-osgi-compiler-plugin</artifactId>
+	        <version>${tycho-version}</version>
+	        <configuration>
+	          <compilerId>jdt</compilerId>
+	          <usePdeSourceRoots>true</usePdeSourceRoots>
+	          <source>1.5</source>
+	          <target>jsr14</target>
+	        </configuration>
+	      </plugin>
+
          <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/AtomicItemType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/AtomicItemType.java
new file mode 100644
index 0000000..7fc0e6e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/AtomicItemType.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Jesper Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Moller - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+
+/**
+ * Defines an sequence or item of atomic types.
+ * 
+ * @since 2.0
+ */
+public interface AtomicItemType extends ItemType {
+
+	/**
+	 * Returns the schema type of the sequence or type.
+	 * 
+	 * @return The Schema type of the sequence or item.
+	 */
+	public TypeDefinition getTypeDefinition();
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/CollationProvider.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/CollationProvider.java
index d4e55c6..da711e3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/CollationProvider.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/CollationProvider.java
@@ -1,44 +1,44 @@
-/*******************************************************************************

- * Copyright (c) 2009 Jesper Moller, and others

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *     Jesper Moller - initial API and implementation

- *******************************************************************************/

-

-package org.eclipse.wst.xml.xpath2.api;

-

-import java.util.Comparator;

-

-/**

- * Service provider interface for looking up collations from within the

- * dynamic context.

- * 

- * Definition from the XPath2 specification: A collation is a specification of

- * the manner in which strings and URIs are compared and, by extension,

- * ordered. For a more complete definition of collation, see [XQuery 1.0 and

- * XPath 2.0 Functions and Operators (Second Edition)].

- * @since 2.0

- */

-public interface CollationProvider {

-	/**

-	 * The default collation which is guaranteed to always be implemented

-	 */

-	public static final String CODEPOINT_COLLATION = "http://www.w3.org/2005/xpath-functions/collation/codepoint";

-

-	/**

-	 * Gets the named collator. W3C does not define collation names (yet?) so

-	 * we are constrained to using an implementation-defined naming scheme.

-	 * 

-	 * @param name

-	 *            A URI designating the collation to use

-	 * @return The collation to use, or null if no such collation exists by

-	 *         this provider

-	 */

-	Comparator/*<String>*/ getCollation(String name);

-	

-	String getDefaultCollation();

-}

+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Moller - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api;
+
+import java.util.Comparator;
+
+/**
+ * Service provider interface for looking up collations from within the
+ * dynamic context.
+ * 
+ * Definition from the XPath2 specification: A collation is a specification of
+ * the manner in which strings and URIs are compared and, by extension,
+ * ordered. For a more complete definition of collation, see [XQuery 1.0 and
+ * XPath 2.0 Functions and Operators (Second Edition)].
+ * @since 2.0
+ */
+public interface CollationProvider {
+	/**
+	 * The default collation which is guaranteed to always be implemented
+	 */
+	public static final String CODEPOINT_COLLATION = "http://www.w3.org/2005/xpath-functions/collation/codepoint";
+
+	/**
+	 * Gets the named collator. W3C does not define collation names (yet?) so
+	 * we are constrained to using an implementation-defined naming scheme.
+	 * 
+	 * @param name
+	 *            A URI designating the collation to use
+	 * @return The collation to use, or null if no such collation exists by
+	 *         this provider
+	 */
+	Comparator<String> getCollation(String name);
+	
+	String getDefaultCollation();
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/DynamicContext.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/DynamicContext.java
index 1e8af48..fca24ed 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/DynamicContext.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/DynamicContext.java
@@ -1,128 +1,142 @@
-/*******************************************************************************

- * Copyright (c) 2011, Jesper Steen Moller, and others

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *     Jesper Steen Moller - initial API and implementation

- *******************************************************************************/

-

-package org.eclipse.wst.xml.xpath2.api;

-

-import java.util.GregorianCalendar;

-import java.util.Map;

-

-import javax.xml.datatype.Duration;

-import javax.xml.namespace.QName;

-

-import org.w3c.dom.Node;

-

-import com.sun.xml.internal.txw2.Document;

-

-/**

- * Interface for dynamic context. This covers the Dynamic Context as defined by the XPath2 specification, EXCEPT for 

- * context item and size (handled in EvaluationContext) 

- * @since 2.0

- */

-public interface DynamicContext {

-

-	public Node getLimitNode();

-

-	/**

-	 * Get variable.

-	 * 

-	 * @param name

-	 *            is the name of the variable.

-	 * @return variable.

-	 */

-	public ResultSequence getVariable(QName name);

-

-	/**

-	 * Resolve an URI

-	 * 

-	 * @param uri

-	 *            is the possibly relative URI to resolve

-	 * @return the absolutized, resolved URI.

-	 */

-	public String resolveUri(String uri);

-

-	/**

-	 * [Definition: Current dateTime. This

-	 * information represents an implementation-dependent point in time during

-	 * the processing of an expression, and includes an explicit timezone. It

-	 * can be retrieved by the fn:current-dateTime function. If invoked

-	 * multiple times during the execution of an expression, this function

-	 * always returns the same result.]

-     *

-	 * Returns the current date time using the GregorianCalendar.

-	 * 

-	 * @return The current date and time, which will always be same for the dynamic context.

-	 */

-	public GregorianCalendar getCurrentDateTime();

-	/**

-	 * [Definition: Implicit timezone. This

-	 * is the timezone to be used when a date, time, or dateTime value that

-	 * does not have a timezone is used in a comparison or arithmetic

-	 * operation. The implicit timezone is an implementation-defined value of

-	 * type xs:dayTimeDuration. See [XML Schema] for the range of legal values

-	 * of a timezone.]

-	 * 

-	 * @return current date time and implicit timezone.

-	 */

-	public Duration getTimezoneOffset();

-

-	/**

-	 * [Definition: Available documents. This is a mapping of

-	 * strings onto document nodes. The string represents the absolute URI of

-	 * a resource. The document node is the root of a tree that represents

-	 * that resource using the data model. The document node is returned by

-	 * the fn:doc function when applied to that URI.] The set of available

-	 * documents is not limited to the set of statically known documents, and

-	 * it may be empty. If there are one or more URIs in available documents

-	 * that map to a document node D, then the document-uri property of D must

-	 * either be absent, or must be one of these URIs. Note: This means that

-	 * given a document node $N, the result of fn:doc(fn:document-uri($N)) is

-	 * $N will always be True, unless fn:document-uri($N) is an empty

-	 * sequence.

-	 * 

-	 * @param uri

-	 *            is the URI of the document.

-	 * @return document.

-	 */

-	public org.w3c.dom.Document getDocument(String uri);

-	

-	/**

-	 * [Definition: Available collections. This is a mapping of

-	 * strings onto sequences of nodes. The string represents the absolute URI

-	 * of a resource. The sequence of nodes represents the result of the

-	 * fn:collection function when that URI is supplied as the argument. ] The

-	 * set of available collections is not limited to the set of statically

-	 * known collections, and it may be empty. For every document node D that

-	 * is in the target of a mapping in available collections, or that is the

-	 * root of a tree containing such a node, the document-uri property of D

-	 * must either be absent, or must be a URI U such that available documents

-	 * contains a mapping from U to D." Note: This means that for any document

-	 * node $N retrieved using the fn:collection function, either directly or

-	 * by navigating to the root of a node that was returned, the result of

-	 * fn:doc(fn:document-uri($N)) is $N will always be True, unless

-	 * fn:document-uri($N) is an empty sequence. This implies a requirement

-	 * for the fn:doc and fn:collection functions to be consistent in their

-	 * effect. If the implementation uses catalogs or user-supplied URI

-	 * resolvers to dereference URIs supplied to the fn:doc function, the

-	 * implementation of the fn:collection function must take these mechanisms

-	 * into account. For example, an implementation might achieve this by

-	 * mapping the collection URI to a set of document URIs, which are then

-	 * resolved using the same catalog or URI resolver that is used by the

-	 * fn:doc function.*/

-	public Map/*<String, List<Document>>*/ getCollections();

-	/**

-	 * [Definition: Default collection. This is the sequence

-	 * of nodes that would result from calling the fn:collection function with

-	 * no arguments.] The value of default collection may be initialized by

-	 * the implementation.

-	 */	

-	public ResultSequence/*<String, List<Document>>*/ getDefaultCollection();

-

-}

+/*******************************************************************************
+ * Copyright (c) 2011, Jesper Steen Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moller - initial API and implementation
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api;
+
+import java.net.URI;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.datatype.Duration;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * Interface for dynamic context. This covers the Dynamic Context as defined by the XPath2 specification, EXCEPT for 
+ * context item and size (handled in EvaluationContext) 
+ * @since 2.0
+ */
+public interface DynamicContext {
+
+	/**
+	 * Returns a "top" node which the XPath2 engine is not allowed to
+	 * leave
+	 * 
+	 * @return DOM node which limits axis navigation.
+	 */
+	public Node getLimitNode();
+
+	/**
+	 * Get variable.
+	 * 
+	 * @param name
+	 *            is the name of the variable.
+	 * @return variable.
+	 */
+	public ResultSequence getVariable(QName name);
+
+	/**
+	 * Resolve an URI
+	 * 
+	 * @param uri
+	 *            is the possibly relative URI to resolve
+	 * @return the absolutized, resolved URI.
+	 */
+	public URI resolveUri(String uri);
+
+	/**
+	 * [Definition: Current dateTime. This
+	 * information represents an implementation-dependent point in time during
+	 * the processing of an expression, and includes an explicit timezone. It
+	 * can be retrieved by the fn:current-dateTime function. If invoked
+	 * multiple times during the execution of an expression, this function
+	 * always returns the same result.]
+     *
+	 * Returns the current date time using the GregorianCalendar.
+	 * 
+	 * @return The current date and time, which will always be same for the dynamic context.
+	 */
+	public GregorianCalendar getCurrentDateTime();
+	/**
+	 * [Definition: Implicit timezone. This
+	 * is the timezone to be used when a date, time, or dateTime value that
+	 * does not have a timezone is used in a comparison or arithmetic
+	 * operation. The implicit timezone is an implementation-defined value of
+	 * type xs:dayTimeDuration. See [XML Schema] for the range of legal values
+	 * of a timezone.]
+	 * 
+	 * @return current date time and implicit timezone.
+	 */
+	public Duration getTimezoneOffset();
+
+	/**
+	 * [Definition: Available documents. This is a mapping of
+	 * strings onto document nodes. The string represents the absolute URI of
+	 * a resource. The document node is the root of a tree that represents
+	 * that resource using the data model. The document node is returned by
+	 * the fn:doc function when applied to that URI.] The set of available
+	 * documents is not limited to the set of statically known documents, and
+	 * it may be empty. If there are one or more URIs in available documents
+	 * that map to a document node D, then the document-uri property of D must
+	 * either be absent, or must be one of these URIs. Note: This means that
+	 * given a document node $N, the result of fn:doc(fn:document-uri($N)) is
+	 * $N will always be True, unless fn:document-uri($N) is an empty
+	 * sequence.
+	 * 
+	 * @param uri
+	 *            is the URI of the document.
+	 * @return document.
+	 */
+	public org.w3c.dom.Document getDocument(URI uri);
+	
+	/**
+	 * [Definition: Available collections. This is a mapping of
+	 * strings onto sequences of nodes. The string represents the absolute URI
+	 * of a resource. The sequence of nodes represents the result of the
+	 * fn:collection function when that URI is supplied as the argument. ] The
+	 * set of available collections is not limited to the set of statically
+	 * known collections, and it may be empty. For every document node D that
+	 * is in the target of a mapping in available collections, or that is the
+	 * root of a tree containing such a node, the document-uri property of D
+	 * must either be absent, or must be a URI U such that available documents
+	 * contains a mapping from U to D." Note: This means that for any document
+	 * node $N retrieved using the fn:collection function, either directly or
+	 * by navigating to the root of a node that was returned, the result of
+	 * fn:doc(fn:document-uri($N)) is $N will always be True, unless
+	 * fn:document-uri($N) is an empty sequence. This implies a requirement
+	 * for the fn:doc and fn:collection functions to be consistent in their
+	 * effect. If the implementation uses catalogs or user-supplied URI
+	 * resolvers to dereference URIs supplied to the fn:doc function, the
+	 * implementation of the fn:collection function must take these mechanisms
+	 * into account. For example, an implementation might achieve this by
+	 * mapping the collection URI to a set of document URIs, which are then
+	 * resolved using the same catalog or URI resolver that is used by the
+	 * fn:doc function.*/
+	public Map<String, List<Document>> getCollections();
+	/**
+	 * [Definition: Default collection. This is the sequence
+	 * of nodes that would result from calling the fn:collection function with
+	 * no arguments.] The value of default collection may be initialized by
+	 * the implementation.
+	 */	
+	public List<Document> getDefaultCollection();
+
+	/** 
+	 * Actual collation providers available for use dynamically. This could
+	 * differ from the collations available statically, but would give
+	 * unexpected results.
+	 */
+	public CollationProvider getCollationProvider();
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/EvaluationContext.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/EvaluationContext.java
index 7a26a61..2f6a54c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/EvaluationContext.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/EvaluationContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@
 	 * sequence obtained by evaluating E1 becomes the context item in the
 	 * inner focus for an evaluation of E2.
 	 */
-	Object getContextItem();
+	Item getContextItem();
 
 	/**
 	 * [Definition: The context position
@@ -45,6 +45,7 @@
 	 * size.
 	 */
 	int getContextPosition();
+	
 	/**
 	 * [Definition: The context size is the number of items in the
 	 * sequence of items currently being processed.] Its value is always an
@@ -60,6 +61,13 @@
 	 */
 	int getLastPosition();
 	
+	/**
+	 * @return The current dynamic context in effect.
+	 */
 	DynamicContext getDynamicContext();
+	
+	/**
+	 * @return The current static context in effect.
+	 */
 	StaticContext getStaticContext();
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Function.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Function.java
index ec57127..4b5874a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Function.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Function.java
@@ -1,99 +1,100 @@
-/*******************************************************************************

- * Copyright (c) 2009 Jesper Moller, and others

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *     Jesper Moller - initial API and implementation

- *******************************************************************************/

-

-package org.eclipse.wst.xml.xpath2.api;

-

-import java.util.Collection;

-

-import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;

-

-/**

- * Support for functions.

- */

-public interface Function {

-

-	/**

-	 * Support for QName interface.

-	 * 

-	 * @return Result of QName operation.

-	 */

-	String getName();

-

-	/**

-	 * Minimal number of allowed arguments.

-	 * 

-	 * @return The smallest number of arguments possible

-	 */

-	int getMinArity();

-

-	/**

-	 * Maximum number of allowed arguments.

-	 * 

-	 * @return The highest number of arguments possible

-	 */

-	int getMaxArity();

-

-	/**

-	 * Maximum number of allowed arguments.

-	 * 

-	 * @return The highest number of arguments possible

-	 */

-	boolean isVariableArgument();

-

-	/**

-	 * Checks if this function has an to the

-	 * 

-	 * @param actual_arity

-	 * @return

-	 */

-	boolean canMatchArity(int actualArity);

-

-	/**

-	 * Gets the return type for the function.

-	 * 

-	 * @return TypeDefinition for the argument

-	 */

-	TypeDefinition getResultType();

-

-	/**

-	 * Returns the type of the argument at position index,

-	 * starting at 0.  

-	 * 

-	 * @return TypeDefinition for the argument

-	 */

-	TypeDefinition getArgumentType(int index);

-

-	/**

-	 * Name hint for the index'th argument,  

-	 * starting at 0.

-	 * 

-	 * @return TypeDefinition for the argument

-	 */

-	String getArgumentNameHint(int index);

-

-	/**

-	 * Evaluate arguments.

-	 * 

-	 * @param args

-	 *            argument expressions.

-	 * @return Result of evaluation.

-	 */

-	ResultSequence evaluate(Collection/*<ResultSequence>*/ args, EvaluationContext evaluationContext);

-

-	/**

-	 * Evaluate the exact result type.

-	 * 

-	 * @param args

-	 *            argument expressions.

-	 * @return Result of evaluation.

-	 */

-	TypeDefinition computeReturnType(Collection/*<TypeDefinition>*/ args, StaticContext sc);

-}

+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Moller - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api;
+
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+
+/**
+ * Support for functions.
+ * @since 2.0
+ */
+public interface Function {
+
+	/**
+	 * Support for QName interface.
+	 * 
+	 * @return Result of QName operation.
+	 */
+	String getName();
+
+	/**
+	 * Minimal number of allowed arguments.
+	 * 
+	 * @return The smallest number of arguments possible
+	 */
+	int getMinArity();
+
+	/**
+	 * Maximum number of allowed arguments.
+	 * 
+	 * @return The highest number of arguments possible
+	 */
+	int getMaxArity();
+
+	/**
+	 * Maximum number of allowed arguments.
+	 * 
+	 * @return The highest number of arguments possible
+	 */
+	boolean isVariableArgument();
+
+	/**
+	 * Checks if this function has an to the
+	 * 
+	 * @param actual_arity
+	 * @return
+	 */
+	boolean canMatchArity(int actualArity);
+
+	/**
+	 * Gets the return type for the function.
+	 * 
+	 * @return TypeDefinition for the argument
+	 */
+	TypeDefinition getResultType();
+
+	/**
+	 * Returns the type of the argument at position index,
+	 * starting at 0.  
+	 * 
+	 * @return TypeDefinition for the argument
+	 */
+	TypeDefinition getArgumentType(int index);
+
+	/**
+	 * Name hint for the index'th argument,  
+	 * starting at 0.
+	 * 
+	 * @return TypeDefinition for the argument
+	 */
+	String getArgumentNameHint(int index);
+
+	/**
+	 * Evaluate arguments.
+	 * 
+	 * @param args
+	 *            argument expressions.
+	 * @return Result of evaluation.
+	 */
+	ResultSequence evaluate(Collection<ResultSequence> args, EvaluationContext evaluationContext);
+
+	/**
+	 * Evaluate the exact result type.
+	 * 
+	 * @param args
+	 *            argument expressions.
+	 * @return Result of evaluation.
+	 */
+	TypeDefinition computeReturnType(Collection<TypeDefinition> args, StaticContext sc);
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Item.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Item.java
index 0e91a0b..8e86b4b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Item.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Item.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,18 +14,23 @@
 import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
 
 /**
- * A match found by the XPath2 pattern matcher
+ * An item in the XPath2 data model
  * 
- * * @noimplement This interface is not intended to be implemented by clients.
  * @since 2.0
- *
+ * @noimplement This interface is not intended to be implemented by clients.
  */
 
 public interface Item {
 	/**
-	 * @return The number of matching patterns on the input.
+	 * @return A description of the item type.
 	 */
-	ItemType getType();
-	
-	Object getValue();
+	ItemType getItemType();
+
+	/**
+	 * @return The "Raw" Java object, e.g. org.w3.Node for a node,
+	 *         java.util.String for strings, etc.
+	 */
+	Object getNativeValue();
+
+	String getStringValue();
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Match.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Match.java
index aa8d5c5..3d0eeab 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Match.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/Match.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/ResultBuffer.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/ResultBuffer.java
new file mode 100644
index 0000000..e69a421
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/ResultBuffer.java
@@ -0,0 +1,375 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Jesper Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Moller - initial API and implementation
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ListIterator;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence;
+
+/**
+ * @since 2.0
+ */
+public class ResultBuffer {
+
+	private ArrayList<Item> values = new ArrayList<Item>();
+	
+	public ResultSequence getSequence() {
+		if (values.size() == 0) return EMPTY;
+		if (values.size() == 1) return wrap(values.get(0));
+		
+		return new ArrayResultSequence(values.toArray(new Item[values.size()]));
+	}
+	
+	public void clear() {
+		values.clear();
+	}
+	
+	public ResultBuffer add(Item at) {
+		values.add(at);
+		return this;
+	}
+
+	public ResultBuffer append(Item at) {
+		values.add(at);
+		return this;
+	}
+
+	public ResultBuffer concat(ResultSequence rs) {
+		values.addAll(collectionWrapper(rs));
+		return this;
+	}
+
+	public static final class SingleResultSequence implements ResultSequence {
+		
+		public SingleResultSequence(Item at) {
+			value = at;
+		}
+		
+		private final Item value;
+	
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#getLength()
+		 */
+		public int size() {
+			return 1;
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#getItem(int)
+		 */
+		public Item item(int index) {
+			if (index != 0) throw new IndexOutOfBoundsException("Length is one, you looked up number "+ index);
+			return value;
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#first()
+		 */
+		public Item first() {
+			return item(0);
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#getItem(int)
+		 */
+		public Object value(int index) {
+			if (index != 0) throw new IndexOutOfBoundsException("Length is one, you looked up number "+ index);
+			return value.getNativeValue();
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#empty()
+		 */
+		public boolean empty() {
+			return false;
+		}
+	
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#first()
+		 */
+		public Object firstValue() {
+			return value.getNativeValue();
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#iterator()
+		 */
+		public Iterator iterator() {
+			return new Iterator() {
+				boolean seenIt = false;
+				
+				public final void remove() {
+					throw new UnsupportedOperationException("ResultSequences are immutable");
+				}
+				
+				public final Object next() {
+					if (! seenIt) {
+						seenIt = true;
+						return value;
+					}
+					throw new IllegalStateException("This iterator is at its end");
+				}
+				
+				public final boolean hasNext() {
+					return !seenIt;
+				}
+			};
+		}
+
+		public ItemType itemType(int index) {
+			return item(index).getItemType();
+		}
+		
+		public ItemType sequenceType() {
+			return value.getItemType();
+		}
+	}
+
+	public static final class ArrayResultSequence implements ResultSequence {
+		
+		private final Item[] results;
+	
+		public ArrayResultSequence(Item results[]) {
+			this.results = results;
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#getLength()
+		 */
+		public int size() {
+			return results.length;
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#getItem(int)
+		 */
+		public Item item(int index) {
+			if (index < 0 && index >= results.length) throw new IndexOutOfBoundsException("Index " + index + " is out of alllowed bounds (less that " + results.length);
+			return results[index];
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#empty()
+		 */
+		public boolean empty() {
+			return false;
+		}
+	
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#first()
+		 */
+		public Object firstValue() {
+			return item(0).getNativeValue();
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#first()
+		 */
+		public Item first() {
+			return item(0);
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.wst.xml.xpath2.api.ResultSequence#iterator()
+		 */
+		public Iterator iterator() {
+			return new Iterator() {
+				int nextIndex = 0;
+				
+				public final void remove() {
+					throw new UnsupportedOperationException("ResultSequences are immutable");
+				}
+				
+				public final Object next() {
+					if (nextIndex < results.length) {
+						return results[nextIndex++];
+					}
+					throw new IllegalStateException("This iterator is at its end");
+				}
+				
+				public final boolean hasNext() {
+					return nextIndex < results.length;
+				}
+			};
+		}
+
+		public ItemType itemType(int index) {
+			if (index < 0 && index >= results.length) throw new IndexOutOfBoundsException("Index " + index + " is out of alllowed bounds (less that " + results.length);
+			return results[index].getItemType();
+		}
+
+		public ItemType sequenceType() {
+			return new SimpleAtomicItemTypeImpl(BuiltinTypeLibrary.XS_ANYTYPE, ItemType.OCCURRENCE_ONE_OR_MANY);
+		}
+
+		public Object value(int index) {
+			return item(index).getNativeValue();
+		}
+	}
+
+	public int size() {
+		return values.size();
+	}
+
+	public ListIterator iterator() {
+		return values.listIterator();
+	}
+
+	public void prepend(ResultSequence rs) {
+		values.addAll(0, collectionWrapper(rs));
+	}
+
+	private Collection<Item> collectionWrapper(final ResultSequence rs) {
+		// This is a dummy collections, solely exists for faster inserts into our array
+		return new Collection<Item>() {
+
+			public boolean add(Item arg0) {
+				return false;
+			}
+
+			public boolean addAll(Collection arg0) {
+				return false;
+			}
+
+			public void clear() {
+			}
+
+			public boolean contains(Object arg0) {
+				return false;
+			}
+
+			public boolean containsAll(Collection arg0) {
+				return false;
+			}
+
+			public boolean isEmpty() {
+				return rs.empty();
+			}
+
+			public Iterator/*<Item>*/ iterator() {
+				return rs.iterator();
+			}
+
+			public boolean remove(Object arg0) {
+				return false;
+			}
+
+			public boolean removeAll(Collection arg0) {
+				return false;
+			}
+
+			public boolean retainAll(Collection arg0) {
+				return false;
+			}
+
+			public int size() {
+				return rs.size();
+			}
+
+			public Object[] toArray() {
+				return toArray(new Item[size()]);
+			}
+
+			public Object[] toArray(Object[] arg0) {
+				if (arg0.length < size())
+					arg0 = new Item[size()];
+				for (int i = 0; i< size(); ++i) {
+					arg0[i] = rs.item(i);
+				}
+				return arg0;
+			}
+		};
+	}
+	
+	public final static ResultSequence EMPTY = new ResultSequence() {
+
+		public int size() {
+			return 0;
+		}
+
+		public Item item(int index) {
+			throw new IndexOutOfBoundsException("Sequence is empty!");
+		}
+
+		public boolean empty() {
+			return true;
+		}
+		
+		public ItemType itemType(int index) {
+			throw new IndexOutOfBoundsException("Sequence is empty!");
+		}
+		
+		public ItemType sequenceType() {
+			return new SimpleAtomicItemTypeImpl(BuiltinTypeLibrary.XS_ANYTYPE, ItemType.OCCURRENCE_ONE_OR_MANY);
+		}
+		
+		public Object value(int index) {
+			throw new IndexOutOfBoundsException("Sequence is empty!");
+		}
+		
+		public Object firstValue() {
+			throw new IndexOutOfBoundsException("Sequence is empty!");
+		}
+
+		public Item first() {
+			throw new IndexOutOfBoundsException("Sequence is empty!");
+		}
+		
+		public Iterator iterator() {
+			return new Iterator() {
+				
+				public void remove() {
+					throw new UnsupportedOperationException("ResultSequences are immutable");
+				}
+				
+				public Object next() {
+					throw new IllegalStateException("This ResultSequence is empty");
+				}
+				
+				public boolean hasNext() {
+					return false;
+				}
+			};
+		}
+	};
+
+	public Collection<Item> getCollection() {
+		return this.values;
+	}
+
+	public ResultBuffer concat(Collection/*<Item>*/ others) {
+		this.values.addAll(others);
+		return this;
+	}
+
+	public static ResultSequence wrap(Item item) {
+		if (item instanceof SingleItemSequence)
+			return (SingleItemSequence)item;
+		
+		return new SingleResultSequence(item); 
+	}
+
+	public Item item(int index) {
+		return values.get(index);
+	}
+
+	public void addAt(int pos, Item element) {
+		values.add(pos, element);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/ResultSequence.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/ResultSequence.java
index 82bb9c6..5db105a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/ResultSequence.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/ResultSequence.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,13 +7,14 @@
  *
  * Contributors:
  *     Jesper Moller - initial API and implementation
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.api;
 
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
 
 /**
  * Immutable representation of a result
@@ -35,26 +36,35 @@
 	 * @param index
 	 * @return Native object representing the item.
 	 */
-	Object item(int index);
-	
+	Object value(int index);
+
+	/**
+	 * Return the item.
+	 * 
+	 * @param index
+	 * @return Native object representing the item.
+	 */
+	Item item(int index);
+
+	/**
+	 * Return the native representation of the first item.
+	 * 
+	 * @return Native object representing the first item.
+	 */
+	Object firstValue();
+
 	/**
 	 * XPath2 type definition description of the item at location '0'
 	 * 
 	 * @param index
 	 * @return
 	 */
-	TypeDefinition itemType(int index);
+	ItemType itemType(int index);
 	
 	/**
-	 * XPath2 type definition description of the item at location '0'
+	 * Is the sequence empty.
 	 * 
-	 * @param index
-	 * @return
-	 */
-	TypeDefinition sequenceType();
-	
-	/**
-	 * @return
+	 * @return true for empty sequences
 	 */
 	boolean empty();
 
@@ -63,5 +73,19 @@
 	 * 
 	 * @return
 	 */
-	Iterator iterator();
+	Iterator<Item> iterator();
+
+	/**
+	 * 
+	 * 
+	 * @return
+	 */
+	Item first();
+	
+	/**
+	 * Describe the whole sequence's type.
+	 * 
+	 * @return Item type definition.
+	 */
+	ItemType sequenceType();
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticContext.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticContext.java
index 6c32a81..393b864 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticContext.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticContext.java
@@ -1,175 +1,175 @@
-/*******************************************************************************

- * Copyright (c) 2011 Jesper Moller, and others

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *     Jesper Moller - initial API and implementation

- *******************************************************************************/

-

-package org.eclipse.wst.xml.xpath2.api;

-

-import java.net.URI;

-import java.util.Collection;

-

-import javax.xml.namespace.NamespaceContext;

-import javax.xml.namespace.QName;

-

-import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;

-import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;

-

-/**

- * interface to static context

- * @since 2.0

- */

-public interface StaticContext {

-	/**

-	 * XPath 1.0 compatibility mode.

-	 * 

-	 * @return true if rules for backward compatibility with XPath Version 1.0

-	 *         are in effect; otherwise false.

-	 */

-	public boolean isXPath1Compatible();

-

-	/**

-	 * [Definition: In-scope variables. This is a set of (expanded QName,

-	 * type) pairs. It defines the set of variables that are available for

-	 * reference within an expression. The expanded QName is the name of the

-	 * variable, and the type is the static type of the variable.] An

-	 * expression that binds a variable (such as a for, some, or every

-	 * expression) extends the in-scope variables of its subexpressions with

-	 * the new bound variable and its type.

-	 */

-	StaticVariableResolver getInScopeVariables();

-

-	 /** 

-	 * [Definition: Context item static type. This component defines the

-	 * static type of the context item within the scope of a given

-	 * expression.]

-	 */

-	TypeDefinition getInitialContextType();

-	

-	 /** 

-	 * [Definition: Function signatures. This component defines the set of

-	 * functions that are available to be called from within an expression.

-	 * Each function is uniquely identified by its expanded QName and its

-	 * arity (number of parameters).] In addition to the name and arity, each

-	 * function signature specifies the static types of the function

-	 * parameters and result. The function signatures include the signatures

-	 * of constructor functions, which are discussed in 3.10.4 Constructor

-	 * Functions.

-	 */

-	public Collection/* <FunctionLibrary> */getFunctionLibraries();

-

-	/** 

-	 * [Definition: Statically known collations. This is an

-	 * implementation-defined set of (URI, collation) pairs. It defines the

-	 * names of the collations that are available for use in processing

-	 * expressions.]

-	 */

-	public CollationProvider getCollationProvider();

-	

-	/**

-	 * [Definition: Base URI. This is an absolute URI, used when necessary in

-	 * the resolution of relative URIs (for example, by the fn:resolve-uri

-	 * function.)] The URI value is whitespace normalized according to the

-	 * rules for the xs:anyURI type in [XML Schema].

-	 */

-	public URI getBaseUri();

-	

-	/**

-	 * [Definition: Statically known documents. This is a mapping from strings

-	 * onto types. The string represents the absolute URI of a resource that

-	 * is potentially available using the fn:doc function. The type is the

-	 * static type of a call to fn:doc with the given URI as its literal

-	 * argument. ] If the argument to fn:doc is a string literal that is not

-	 * present in statically known documents, then the static type of fn:doc

-	 * is document-node()?. Note: The purpose of the statically known

-	 * documents is to provide static type information, not to determine which

-	 * documents are available. A URI need not be found in the statically

-	 * known documents to be accessed using fn:doc.

-	 */

-

-

-	/**

-	 * [Definition: Statically known namespaces. This is a set of (prefix,

-	 * URI) pairs that define all the namespaces that are known during static

-	 * processing of a given expression.] The URI value is whitespace

-	 * normalized according to the rules for the xs:anyURI type in [XML

-	 * Schema]. Note the difference between in-scope namespaces, which is a

-	 * dynamic property of an element node, and statically known namespaces,

-	 * which is a static property of an expression.

-	 * 

-	 * @return The statically known namespace context 

-	 */

-	public NamespaceContext getNamespaceContext();

-

-	/**

-	 *  [Definition: Default element/type namespace. This is a namespace URI or

-	 * "none". The namespace URI, if present, is used for any unprefixed QName

-	 * appearing in a position where an element or type name is expected.] The

-	 * URI value is whitespace normalized according to the rules for the

-	 * xs:anyURI type in [XML Schema].

-	 * 

-	 * @return

-	 */

-	public String getDefaultNamespace();

-	

-	/** 

-	 * Definition: Default function namespace. This is a namespace URI or

-	 * "none". The namespace URI, if present, is used for any unprefixed QName

-	 * appearing in a position where a function name is expected.] The URI

-	 * value is whitespace normalized according to the rules for the xs:anyURI

-	 * type in [XML Schema].

-	 * 

-	 * @return The default function namespace

-	 */

-	public String getDefaultFunctionNamespace();

-

-	/**

-	 * [Definition: In-scope schema definitions. This is a generic term for

-	 * all the element declarations, attribute declarations, and schema type

-	 * definitions that are in scope during processing of an expression.] 

-     *

-  	 * @return A type model which covers the 

-	 */

-	public TypeModel getTypeModel();

-

-	/**

-	 * is the function declared/available in the source context?

-	 * 

-	 * @param name

-	 *            is the qname name

-	 * @param arity

-	 *            integer of qname

-	 * @return boolean

-	 */

-	// function signatures

-	public Function resolveFunction(QName name, int arity);

-

-	/**

-	 * [Definition: Statically known collections. This is a mapping from

-	 * strings onto types. The string represents the absolute URI of a

-	 * resource that is potentially available using the fn:collection

-	 * function. The type is the type of the sequence of nodes that would

-	 * result from calling the fn:collection function with this URI as its

-	 * argument.] If the argument to fn:collection is a string literal that is

-	 * not present in statically known collections, then the static type of

-	 * fn:collection is node()*. Note: The purpose of the statically known

-	 * collections is to provide static type information, not to determine

-	 * which collections are available. A URI need not be found in the

-	 * statically known collections to be accessed using fn:collection.

-	 */

-	public TypeDefinition getCollectionType(String collectionName);

-

-	/**

-	 * [Definition: Statically known default collection type. This is the type

-	 * of the sequence of nodes that would result from calling the

-	 * fn:collection function with no arguments.] Unless initialized to some

-	 * other value by an implementation, the value of statically known default

-	 * collection type is node()*.

-	 */

-	public TypeDefinition getDefaultCollectionType();

-}

+/*******************************************************************************
+ * Copyright (c) 2011 Jesper Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Moller - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api;
+
+import java.net.URI;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
+
+/**
+ * interface to static context
+ * @since 2.0
+ */
+public interface StaticContext {
+	/**
+	 * XPath 1.0 compatibility mode.
+	 * 
+	 * @return true if rules for backward compatibility with XPath Version 1.0
+	 *         are in effect; otherwise false.
+	 */
+	public boolean isXPath1Compatible();
+
+	/**
+	 * [Definition: In-scope variables. This is a set of (expanded QName,
+	 * type) pairs. It defines the set of variables that are available for
+	 * reference within an expression. The expanded QName is the name of the
+	 * variable, and the type is the static type of the variable.] An
+	 * expression that binds a variable (such as a for, some, or every
+	 * expression) extends the in-scope variables of its subexpressions with
+	 * the new bound variable and its type.
+	 */
+	StaticVariableResolver getInScopeVariables();
+
+	 /** 
+	 * [Definition: Context item static type. This component defines the
+	 * static type of the context item within the scope of a given
+	 * expression.]
+	 */
+	TypeDefinition getInitialContextType();
+	
+	 /** 
+	 * [Definition: Function signatures. This component defines the set of
+	 * functions that are available to be called from within an expression.
+	 * Each function is uniquely identified by its expanded QName and its
+	 * arity (number of parameters).] In addition to the name and arity, each
+	 * function signature specifies the static types of the function
+	 * parameters and result. The function signatures include the signatures
+	 * of constructor functions, which are discussed in 3.10.4 Constructor
+	 * Functions.
+	 */
+	public Map<String, FunctionLibrary> getFunctionLibraries();
+
+	/** 
+	 * [Definition: Statically known collations. This is an
+	 * implementation-defined set of (URI, collation) pairs. It defines the
+	 * names of the collations that are available for use in processing
+	 * expressions.]
+	 */
+	public CollationProvider getCollationProvider();
+	
+	/**
+	 * [Definition: Base URI. This is an absolute URI, used when necessary in
+	 * the resolution of relative URIs (for example, by the fn:resolve-uri
+	 * function.)] The URI value is whitespace normalized according to the
+	 * rules for the xs:anyURI type in [XML Schema].
+	 */
+	public URI getBaseUri();
+	
+	/**
+	 * [Definition: Statically known documents. This is a mapping from strings
+	 * onto types. The string represents the absolute URI of a resource that
+	 * is potentially available using the fn:doc function. The type is the
+	 * static type of a call to fn:doc with the given URI as its literal
+	 * argument. ] If the argument to fn:doc is a string literal that is not
+	 * present in statically known documents, then the static type of fn:doc
+	 * is document-node()?. Note: The purpose of the statically known
+	 * documents is to provide static type information, not to determine which
+	 * documents are available. A URI need not be found in the statically
+	 * known documents to be accessed using fn:doc.
+	 */
+	public ItemType getDocumentType(URI documentUri);
+
+	/**
+	 * [Definition: Statically known namespaces. This is a set of (prefix,
+	 * URI) pairs that define all the namespaces that are known during static
+	 * processing of a given expression.] The URI value is whitespace
+	 * normalized according to the rules for the xs:anyURI type in [XML
+	 * Schema]. Note the difference between in-scope namespaces, which is a
+	 * dynamic property of an element node, and statically known namespaces,
+	 * which is a static property of an expression.
+	 * @return The statically known namespace context 
+	 */
+	public NamespaceContext getNamespaceContext();
+
+	/**
+	 *  [Definition: Default element/type namespace. This is a namespace URI or
+	 * "none". The namespace URI, if present, is used for any unprefixed QName
+	 * appearing in a position where an element or type name is expected.] The
+	 * URI value is whitespace normalized according to the rules for the
+	 * xs:anyURI type in [XML Schema].
+	 * 
+	 * @return
+	 */
+	public String getDefaultNamespace();
+	
+	/** 
+	 * Definition: Default function namespace. This is a namespace URI or
+	 * "none". The namespace URI, if present, is used for any unprefixed QName
+	 * appearing in a position where a function name is expected.] The URI
+	 * value is whitespace normalized according to the rules for the xs:anyURI
+	 * type in [XML Schema].
+	 * 
+	 * @return The default function namespace
+	 */
+	public String getDefaultFunctionNamespace();
+
+	/**
+	 * [Definition: In-scope schema definitions. This is a generic term for
+	 * all the element declarations, attribute declarations, and schema type
+	 * definitions that are in scope during processing of an expression.] 
+     *
+  	 * @return A type model which covers the 
+	 */
+	public TypeModel getTypeModel();
+
+	/**
+	 * is the function declared/available in the source context?
+	 * 
+	 * @param name
+	 *            is the qname name
+	 * @param arity
+	 *            integer of qname
+	 * @return boolean
+	 */
+	// function signatures
+	public Function resolveFunction(QName name, int arity);
+
+	/**
+	 * [Definition: Statically known collections. This is a mapping from
+	 * strings onto types. The string represents the absolute URI of a
+	 * resource that is potentially available using the fn:collection
+	 * function. The type is the type of the sequence of nodes that would
+	 * result from calling the fn:collection function with this URI as its
+	 * argument.] If the argument to fn:collection is a string literal that is
+	 * not present in statically known collections, then the static type of
+	 * fn:collection is node()*. Note: The purpose of the statically known
+	 * collections is to provide static type information, not to determine
+	 * which collections are available. A URI need not be found in the
+	 * statically known collections to be accessed using fn:collection.
+	 */
+	public TypeDefinition getCollectionType(String collectionName);
+
+	/**
+	 * [Definition: Statically known default collection type. This is the type
+	 * of the sequence of nodes that would result from calling the
+	 * fn:collection function with no arguments.] Unless initialized to some
+	 * other value by an implementation, the value of statically known default
+	 * collection type is node()*.
+	 */
+	public TypeDefinition getDefaultCollectionType();
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticVariableResolver.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticVariableResolver.java
index 20fe7f0..7cd8679 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticVariableResolver.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/StaticVariableResolver.java
@@ -1,47 +1,36 @@
-/*******************************************************************************

- * Copyright (c) 2009 Jesper Moller, and others

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *     Jesper Moller - initial API and implementation

- *******************************************************************************/

-

-package org.eclipse.wst.xml.xpath2.api;

-

-import javax.xml.namespace.QName;

-

-import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;

-

-/**

- * @since 2.0

- */

-public interface StaticVariableResolver {

-

-	/**

-	 * Is the variable present in the current context.

-	 * 

-	 * @param name Variable name

-	 * @return Availability of the variable

-	 */

-	boolean isVariablePresent(QName name);

-	

-	/** 

-	 * @param name

-	 * @return

-	 */

-	TypeDefinition getVariableType(QName name);

-

-	/** 

-	 * @param name

-	 * @return

-	 */

-	short getVariableOccurrence(QName name);

-

-	public static final short OPTIONAL = 0;

-	public static final short ONE = 1;

-	public static final short ANY = 2;

-	public static final short MANY = 3;

-}

+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Moller - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api;
+
+import javax.xml.namespace.QName;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
+
+/**
+ * @since 2.0
+ */
+public interface StaticVariableResolver {
+
+	/**
+	 * Is the variable present in the current context.
+	 * 
+	 * @param name Variable name
+	 * @return Availability of the variable
+	 */
+	boolean isVariablePresent(QName name);
+	
+	/** 
+	 * @param name
+	 * @return
+	 */
+	ItemType getVariableType(QName name);
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Engine.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Engine.java
index 77ca7a2..0537551 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Engine.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Engine.java
@@ -28,5 +28,4 @@
 	 * @return A compiled expression.
 	 */
 	XPath2Expression parseExpression(String expression, StaticContext context);
-	XPath2PatternSet createPatternSet();
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Expression.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Expression.java
index a0ce399..4f8b19a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Expression.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Expression.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,8 @@
 
 import java.util.Collection;
 
+import javax.xml.namespace.QName;
+
 /**
  * This interface represents a parsed and statically bound XPath2 expression.
  * 
@@ -27,23 +29,30 @@
 	 *  
 	 * @return A Collection containing javax.xml.namespacing.QName of free variables
 	 */
-	Collection/*<QName>*/ getFreeVariables();
+	Collection<QName> getFreeVariables();
 
 	/**
 	 * Return a collections of the functions used in the XPath2 expression.
 	 *  
 	 * @return A Collection containing javax.xml.namespacing.QName of functions in use.
 	 */
-	Collection/*<QName>*/ getResolvedFunctions();
+	Collection<QName> getResolvedFunctions();
 
 	/**
-	 * Return a collections of the functions used in the XPath2 expression.
+	 * Return a collections of the axis used in the XPath2 expression.
 	 *  
-	 * @return A Collection containing javax.xml.namespacing.QName of functions in use.
+	 * @return A Collection containing Strings with the axis names in use.
 	 */
-	Collection/*<String>*/ getAxes();
+	Collection<String> getAxes();
 
 	/**
+	 * Whether or not the root path is in use in the XPath2 expression.
+	 *  
+	 * @return true if the expression uses / or //, false otherwise.
+	 */
+	boolean isRootPathUsed();
+	
+	/**
 	 * Evaluate the XPath2 expression, using the supplied DynamicContext.
 	 * 
 	 * @param dynamicContext Dynamic context for the expression.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Pattern.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Pattern.java
index f23561d..92c9be8 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Pattern.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2Pattern.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2PatternSet.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2PatternSet.java
index aa7b4f1..ddb3ac0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2PatternSet.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/XPath2PatternSet.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 
 /**
  * @noimplement This interface is not intended to be implemented by clients.
+ * @since 2.0
  */
 public interface XPath2PatternSet {
 	
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ComplexTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ComplexTypeDefinition.java
index 6c8cad4..dfb9c12 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ComplexTypeDefinition.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ComplexTypeDefinition.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ItemType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ItemType.java
index 5eefd66..535a722 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ItemType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/ItemType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,5 +15,14 @@
  * @since 2.0
  */
 public interface ItemType {
-	// details await
+	
+	public short getOccurrence();
+	
+	public final static short OCCURRENCE_OPTIONAL = 0;
+	public final static short OCCURRENCE_ONE = 1;
+	public final static short OCCURRENCE_NONE_OR_MANY = 2;
+	public final static short OCCURRENCE_ONE_OR_MANY = 3;
+
+	public final static short ALWAYS_ONE_MASK = 0x01;
+	public final static short MAYBE_MANY_MASK = 0x02;
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/NodeItemType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/NodeItemType.java
new file mode 100644
index 0000000..a894548
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/NodeItemType.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Jesper Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Moller - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.api.typesystem;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @since 2.0
+ */
+public interface NodeItemType extends ItemType {
+	/**
+	 * For attribute and element types, return whether the name
+	 * part of the type test is a wildcard.
+	 * 
+	 * @return Wildcard test?
+	 */
+	boolean isWildcard();
+	
+	/**
+	 * @return name of the item type, if applicable, otherwise null
+	 */
+	QName getName();
+
+	/**
+	 * Node type as per list in org.w3c.dom.Node
+	 * 
+	 * @return The DOM node type
+	 */
+	short getNodeType();
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/PrimitiveType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/PrimitiveType.java
index 69010e5..4093a50 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/PrimitiveType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/PrimitiveType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/SimpleTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/SimpleTypeDefinition.java
index 6722b84..115d2cd 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/SimpleTypeDefinition.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/SimpleTypeDefinition.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeDefinition.java
index 6c1514d..c3b3334 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeDefinition.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeDefinition.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeModel.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeModel.java
index 9751f17..cb7fcf9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeModel.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/TypeModel.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Moller, and others
+ * Copyright (c) 2011 Jesper Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultDynamicContext.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultDynamicContext.java
index 9b72621..d7e23fd 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultDynamicContext.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultDynamicContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
  *     Jesper Moller- bug 280555 - Add pluggable collation support
   *    Mukul Gandhi - bug 325262 - providing ability to store an XPath2 sequence into
  *                                 an user-defined variable.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
@@ -43,6 +44,7 @@
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.xerces.XercesTypeModel;
+import org.eclipse.wst.xml.xpath2.processor.util.ResultSequenceUtil;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -186,7 +188,7 @@
 
 		assert funct != null;
 
-		return funct.evaluate(args);
+		return ResultSequenceUtil.newToOld(funct.evaluate(args));
 	}
 
 	/**
@@ -196,7 +198,6 @@
 	 *            Function library to add.
 	 * 
 	 */
-	@Override
 	public void add_function_library(FunctionLibrary fl) {
 		super.add_function_library(fl);
 		fl.set_dynamic_context(this);
@@ -232,7 +233,7 @@
 			if (realURI.isAbsolute()) {
 				return realURI;
 			} else {
-				URI baseURI = URI.create(base_uri().string_value());
+				URI baseURI = URI.create(base_uri().getStringValue());
 				return baseURI.resolve(uri);
 			}
 		} catch (IllegalArgumentException iae) {
@@ -268,7 +269,6 @@
 	 * @param val
 	 *            Variable value.
 	 */
-	@Override
 	public void set_variable(QName var, AnyType val) {
 		super.set_variable(var, val);
 	}
@@ -310,7 +310,7 @@
 	 * @since 1.1
 	 * 
 	 */
-	public Comparator<Object> get_collation(String uri) {
+	public Comparator get_collation(String uri) {
 		if (CODEPOINT_COLLATION.equals(uri)) return CODEPOINT_COMPARATOR;
 		
 		return _collation_provider != null ? _collation_provider.get_collation(uri) : null;
@@ -330,7 +330,6 @@
 	 * Use focus().position() to retrieve the value.
 	 * @deprecated  This will be removed in a future version use focus().position().
 	 */
-	@Deprecated
 	public int node_position(Node node) {
 	  // unused parameter!
 	  return _focus.position();	
@@ -339,7 +338,6 @@
 	/**
 	 * @since 2.0
 	 */
-	@Override
 	public TypeModel getTypeModel(Node node) {
 		return super.getTypeModel(node);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultEvaluator.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultEvaluator.java
index 8d6502f..88dda5e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultEvaluator.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultEvaluator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,8 @@
  *     Jesper Steen Moller  - bug 312191 - instance of test fails with partial matches
   *    Mukul Gandhi         - bug 325262 - providing ability to store an XPath2 sequence into
  *                                         an user-defined variable.
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *     Jesper Steen Moller - bug 343804 - Updated API information
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
@@ -28,17 +30,25 @@
 import java.util.List;
 import java.util.ListIterator;
 
-import org.apache.xerces.xs.ItemPSVI;
-import org.apache.xerces.xs.XSTypeDefinition;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Function;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
 import org.eclipse.wst.xml.xpath2.processor.ast.XPath;
 import org.eclipse.wst.xml.xpath2.processor.internal.Axis;
 import org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.DynamicContextAdapter;
 import org.eclipse.wst.xml.xpath2.processor.internal.Focus;
 import org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis;
 import org.eclipse.wst.xml.xpath2.processor.internal.ParentAxis;
 import org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis;
 import org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis;
 import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticNameError;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticTypeNameError;
 import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
@@ -97,6 +107,7 @@
 import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathExpr;
 import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode;
 import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.ConstructorFL;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.FnBoolean;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.FnData;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.FnRoot;
@@ -112,6 +123,7 @@
 import org.eclipse.wst.xml.xpath2.processor.internal.function.FsNe;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.FsPlus;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.FsTimes;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.OpExcept;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.OpIntersect;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.OpTo;
@@ -129,11 +141,12 @@
 import org.eclipse.wst.xml.xpath2.processor.internal.types.TextType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+import org.eclipse.wst.xml.xpath2.processor.util.ResultSequenceUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 
 /**
  * Default evaluator interface
@@ -145,36 +158,22 @@
 	private static final QName ANY_ATOMIC_TYPE = new QName("xs",
 			"anyAtomicType", XML_SCHEMA_NS);
 
-	static class DummyError extends Error {
-		/**
-		 * 
-		 */
-		private static final long serialVersionUID = 3161644790881405403L;
-		// 0: dynamic error
-		// 1: type error
-		private int _type;
-
-		public DummyError(int type) {
-			_type = type;
-		}
-
-		public int type() {
-			return _type;
-		}
-	}
-
-	private DynamicContext _dc;
-	private XPathException _err;
-
-	// stuff anyone may use
-	private Collection _g_coll;
-	private XSInteger _g_xsint;
+	private org.eclipse.wst.xml.xpath2.api.DynamicContext _dc;
 
 	// this is a parameter that may be set on a call...
 	// the parameter may become invalid on the next call... i.e. the
 	// previous parameter is not saved... so use with care! [remember...
 	// this thing is highly recursive]
 	private Object _param;
+	private EvaluationContext _ec;
+
+	private StaticContext _sc;
+
+	private Focus _focus = new Focus(ResultBuffer.EMPTY);
+
+	Focus focus() { return _focus ; }
+	
+	void set_focus(Focus f) { _focus = f; }
 
 	static class Pair {
 		public Object _one;
@@ -186,45 +185,124 @@
 		}
 	}
 
+	private void popScope() {
+		if (_innerScope == null) throw new IllegalStateException("Unmatched scope pop");
+		_innerScope = _innerScope.nextScope;
+	}
+
+	private void pushScope(QName var, org.eclipse.wst.xml.xpath2.api.ResultSequence value) {
+		_innerScope = new VariableScope(var, value, _innerScope);		
+	}
+
+	private boolean derivesFrom(NodeType at, QName et) {
+		TypeDefinition td = _sc.getTypeModel().getType(at.node_value());
+
+		short method = TypeDefinition.DERIVATION_EXTENSION | TypeDefinition.DERIVATION_RESTRICTION;
+		return td != null && td.derivedFrom(et.namespace(), et.local(), method);
+	}
+
+	private boolean derivesFrom(NodeType at, TypeDefinition td) {
+		TypeDefinition nodeTd = _sc.getTypeModel().getType(at.node_value());
+		short method = TypeDefinition.DERIVATION_EXTENSION | TypeDefinition.DERIVATION_RESTRICTION;
+		return nodeTd != null && nodeTd.derivedFromType(td, method);
+	}
+
+	public DefaultEvaluator(org.eclipse.wst.xml.xpath2.processor.DynamicContext dynamicContext, Document doc) {
+		this(new StaticContextAdapter(dynamicContext), new DynamicContextAdapter(dynamicContext));
+		
+		ResultSequence focusSequence = (doc != null) ? new DocType(doc, _sc.getTypeModel()) : ResultBuffer.EMPTY;   
+		set_focus(new Focus(focusSequence));
+		dynamicContext.set_focus(focus());
+	}
+	
 	/**
-	 * set parameters
-	 * 
-	 * @param dc
-	 *            is the dynamic context.
-	 * @param doc
-	 *            is the document.
+	 * @since 2.0
 	 */
-	public DefaultEvaluator(DynamicContext dc, Document doc) {
-		_dc = dc;
-		_err = null;
+	public DefaultEvaluator(org.eclipse.wst.xml.xpath2.api.StaticContext staticContext, org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext, Object[] contextItems) {
+		this(staticContext, dynamicContext);
 
 		// initialize context item with root of document
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		if (doc != null) rs.add(new DocType(doc, dc.getTypeModel(doc)));
+		ResultBuffer rs = new ResultBuffer();
+		for (Object obj : contextItems) {
+			if (obj instanceof Node) rs.add(NodeType.dom_to_xpath((Node)obj, _sc.getTypeModel()));
+		}
 
-		_dc.set_focus(new Focus(rs));
-
+		set_focus(new Focus(rs.getSequence()));
 		_param = null;
+	}
 
-		_g_coll = new ArrayList();
-		_g_xsint = new XSInteger();
+	private DefaultEvaluator(org.eclipse.wst.xml.xpath2.api.StaticContext staticContext, org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext) {
+		_sc = staticContext;
+		_dc = dynamicContext;
+		_ec = new EvaluationContext() {
+			
+			public org.eclipse.wst.xml.xpath2.api.DynamicContext getDynamicContext() {
+				return _dc;
+			}
+			
+			public AnyType getContextItem() {
+				return _focus.context_item();
+			}
+			
+			public int getContextPosition() {
+				return _focus.position();
+			}
+		
+			public int getLastPosition() {
+				return _focus.last();
+			}
+			
+			public StaticContext getStaticContext() {
+				return _sc;
+			}
+		};
+	}
+
+	class VariableScope {
+		public VariableScope(QName name, org.eclipse.wst.xml.xpath2.api.ResultSequence value, VariableScope nextScope) {
+			this.name = name;
+			this.value = value;
+			this.nextScope = nextScope;
+		}
+		final public QName name;
+		final public org.eclipse.wst.xml.xpath2.api.ResultSequence value;
+		final public VariableScope nextScope; 
+	}	
+	
+	private VariableScope _innerScope = null;
+
+	private org.eclipse.wst.xml.xpath2.api.ResultSequence getVariable(QName name) {
+		// First, try local scopes
+		VariableScope scope = _innerScope;
+		while (scope != null) {
+			if (name.equals(scope.name)) return scope.value;
+			scope = scope.nextScope;
+		}
+		return (org.eclipse.wst.xml.xpath2.api.ResultSequence) _dc.getVariable(name.asQName());
 	}
 
 	// XXX this kinda sux
 	// the problem is that visistor interface does not throw exceptions...
 	// so we get around it ;D
 	private void report_error(DynamicError err) {
-		_err = err;
-		throw new DummyError(0);
+		throw err;
 	}
 
 	private void report_error(TypeError err) {
-		_err = err;
-		throw new DummyError(1);
+		throw new DynamicError(err);
 	}
 
 	private void report_error(StaticNameError err) {
-		throw new DummyError(666);
+		throw err;
+	}
+
+	private AnyAtomicType makeAtomic(QName name) {
+		FunctionLibrary fl = (FunctionLibrary) _sc.getFunctionLibraries().get(name.namespace());
+		if (fl instanceof ConstructorFL) {
+			ConstructorFL cfl = (ConstructorFL)fl;
+			return cfl.atomic_type(name);
+		}
+		return null;
 	}
 
 	/**
@@ -236,44 +314,45 @@
 	 *             error.
 	 * @return result sequence.
 	 */
-	public ResultSequence evaluate(XPathNode node) throws DynamicError {
-		try {
-			return (ResultSequence) node.accept(this);
-		} catch (DummyError e) {
-			switch (e.type()) {
-			case 0:
-				throw (DynamicError) _err;
-			case 1:
-				throw new DynamicError((TypeError) _err);
-
-			default:
-				assert false;
-			}
-		}
-
-		return null; // unreach
-
+	public org.eclipse.wst.xml.xpath2.processor.ResultSequence evaluate(XPathNode node) {
+		return ResultSequenceUtil.newToOld(evaluate2(node));
 	}
 
+	/**
+	 * @since 2.0
+	 */
+	public ResultSequence evaluate2(XPathNode node) {
+		return (org.eclipse.wst.xml.xpath2.api.ResultSequence) node.accept(this);
+	}
+	
 	// basically the comma operator...
 	private ResultSequence do_expr(Iterator i) {
 
 		ResultSequence rs = null;
+		ResultBuffer buffer = null;
 
 		while (i.hasNext()) {
 			Expr e = (Expr) i.next();
 
 			ResultSequence result = (ResultSequence) e.accept(this);
 
-			if (rs == null)
+			if (rs == null && buffer == null)
 				rs = result;
-			else
-				rs.concat(result);
+			else {
+				if (buffer == null) {
+					buffer = new ResultBuffer();
+					buffer.concat(rs);
+					rs = null;
+				}
+				buffer.concat(result);
+			}
 		}
 
-		if (rs == null)
-			rs = ResultSequenceFactory.create_new();
-		return rs;
+		if (buffer != null) {
+			return buffer.getSequence();
+		} else if (rs != null) {
+			return rs;
+		} else return ResultBuffer.EMPTY;
 	}
 
 	/**
@@ -289,17 +368,11 @@
 		return rs;
 	}
 
-	// XXX ugly
-	// type: 0 = for [return == "correct"]
-	// 1 = for all [return false, return empty on true]
-	// 2 = there exists [return true, return empty on false]
-	private ResultSequence do_for_quantified_expr(ListIterator iter,
-			Expr finalexpr, int type) {
+	private void do_for_each(ListIterator iter,
+			Expr finalexpr, ResultBuffer destination) {
 
 		// we have more vars to bind...
 		if (iter.hasNext()) {
-			boolean allocated_var = false;
-			ResultSequence result = ResultSequenceFactory.create_new();
 			VarExprPair ve = (VarExprPair) iter.next();
 
 			// evaluate binding sequence
@@ -308,7 +381,7 @@
 			// XXX
 			if (rs.empty()) {
 				iter.previous();
-				return result;
+				return;
 			}
 
 			QName varname = ve.varname();
@@ -320,64 +393,101 @@
 			for (Iterator i = rs.iterator(); i.hasNext();) {
 				AnyType item = (AnyType) i.next();
 
-				_dc.set_variable(varname, item);
-				allocated_var = true;
-
-				_dc.new_scope();
-				ResultSequence res = do_for_quantified_expr(iter, finalexpr,
-						type);
-				_dc.destroy_scope();
-				assert res != null;
-
-				// ok here we got a "real" result, now figure
-				// out what to do with it
-				XSBoolean effbool = null;
-				switch (type) {
-				// for expression
-				case 0:
-					result.concat(res);
-					break;
-
-				// we need the effective boolean value
-				// of the expression
-				case 1:
-				case 2:
-					effbool = effective_boolean_value(res);
-					break;
-
-				default:
-					assert false;
-				}
-
-				// we got a quantified expression
-				if (effbool != null) {
-					// for all
-					if (type == 1) {
-						result = ResultSequenceFactory.create_new(effbool);
-						if (!effbool.value())
-							break;
-					}
-					// there exists
-					else if (type == 2) {
-						result = ResultSequenceFactory.create_new(effbool);
-						if (effbool.value())
-							break;
-					} else
-						assert false;
-				}
+				pushScope(varname, item);
+				do_for_each(iter, finalexpr, destination);
+				popScope();
 			}
-
-			if (allocated_var) {
-				boolean del = _dc.del_variable(varname);
-				assert del == true;
-			}
-
 			iter.previous();
-			return result;
 		}
 		// we finally got to do the "last expression"
 		else {
-			return (ResultSequence) finalexpr.accept(this);
+			destination.concat((ResultSequence) finalexpr.accept(this));
+		}
+	}
+
+
+	// XXX ugly
+	// type: 0 = for [return == "correct"]
+	// 1 = for all [return false, return empty on true]
+	// 2 = there exists [return true, return empty on false]
+	private XSBoolean do_for_all(ListIterator iter,
+			Expr finalexpr) {
+
+		// we have more vars to bind...
+		if (iter.hasNext()) {
+			VarExprPair ve = (VarExprPair) iter.next();
+
+			// evaluate binding sequence
+			ResultSequence rs = (ResultSequence) ve.expr().accept(this);
+
+			QName varname = ve.varname();
+
+			// for each item of binding sequence, bind the range
+			// variable and check the predicate
+
+			try {
+				for (Iterator i = rs.iterator(); i.hasNext();) {
+					AnyType item = (AnyType) i.next();
+	
+					pushScope(varname, item);
+					XSBoolean effbool = do_for_all(iter, finalexpr);
+					popScope();
+					
+					// ok here we got a "real" result, now figure
+					// out what to do with it
+					if (!effbool.value())
+						return XSBoolean.FALSE;
+				}
+			} finally {
+				iter.previous();
+			}
+			return XSBoolean.TRUE;
+		}
+		// we finally got to do the "last expression"
+		else {
+			return effective_boolean_value((ResultSequence) finalexpr.accept(this));
+		}
+
+	}
+
+	private XSBoolean do_exists(ListIterator iter,
+			Expr finalexpr) {
+
+		// we have more vars to bind...
+		if (iter.hasNext()) {
+			VarExprPair ve = (VarExprPair) iter.next();
+
+			// evaluate binding sequence
+			ResultSequence rs = (ResultSequence) ve.expr().accept(this);
+
+			QName varname = ve.varname();
+
+			// for each item of binding sequence, bind the range
+			// variable and check the expression
+
+			try {
+				for (Iterator i = rs.iterator(); i.hasNext();) {
+					AnyType item = (AnyType) i.next();
+	
+					pushScope(varname, item);
+					XSBoolean effbool = do_exists(iter, finalexpr);
+					popScope();
+	
+					// ok here we got a "real" result, now figure
+					// out what to do with it
+					if (effbool.value())
+						return XSBoolean.TRUE;
+				}
+			} finally {
+				iter.previous();
+			}
+			
+			// since none in this sequence evaluated to true, return false
+			return XSBoolean.FALSE;
+		}
+		// we finally got to do the "last expression"
+		else {
+			return effective_boolean_value((ResultSequence) finalexpr.accept(this));
 		}
 
 	}
@@ -392,7 +502,9 @@
 	public Object visit(ForExpr fex) {
 		// XXX
 		List pairs = new ArrayList(fex.ve_pairs());
-		return do_for_quantified_expr(pairs.listIterator(), fex.expr(), 0);
+		ResultBuffer rb = new ResultBuffer(); 
+		do_for_each(pairs.listIterator(), fex.expr(), rb);
+		return rb.getSequence();
 	}
 
 	/**
@@ -403,40 +515,18 @@
 	 * @return a new function or null.
 	 */
 	public Object visit(QuantifiedExpr qex) {
-		// XXX
 		List pairs = new ArrayList(qex.ve_pairs());
 
-		int hack = 0;
-
 		switch (qex.type()) {
 		case QuantifiedExpr.SOME:
-			hack = 2;
-			break;
+			return do_exists(pairs.listIterator(), qex.expr());
 		case QuantifiedExpr.ALL:
-			hack = 1;
-			break;
+			return do_for_all(pairs.listIterator(), qex.expr());
 
 		default:
 			assert false;
 			return null; // unreach
 		}
-		ResultSequence rs = do_for_quantified_expr(pairs.listIterator(), qex
-				.expr(), hack);
-
-		// make sure we found answer
-		if (!rs.empty())
-			return rs;
-
-		// ok because all of this is a hack... here we go
-		switch (qex.type()) {
-		case QuantifiedExpr.SOME:
-			return ResultSequenceFactory.create_new(new XSBoolean(false));
-		case QuantifiedExpr.ALL:
-			return ResultSequenceFactory.create_new(new XSBoolean(true));
-		default:
-			assert false;
-			return null; // unreach
-		}
 	}
 
 	/**
@@ -501,8 +591,6 @@
 	}
 
 	private ResultSequence node_cmp(int type, Collection args) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		assert args.size() == 2;
 
 		Iterator argsiter = args.iterator();
@@ -517,10 +605,10 @@
 			report_error(TypeError.invalid_type(null));
 
 		if (size_one == 0 || size_two == 0)
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		AnyType at_one = one.first();
-		AnyType at_two = two.first();
+		Item at_one = one.item(0);
+		Item at_two = two.item(0);
 
 		if (!(at_one instanceof NodeType) || !(at_two instanceof NodeType))
 			report_error(TypeError.invalid_type(null));
@@ -549,8 +637,7 @@
 			assert false;
 		}
 
-		rs.add(new XSBoolean(answer));
-		return rs;
+		return XSBoolean.valueOf(answer);
 	}
 
 	/**
@@ -853,6 +940,7 @@
 			int sequenceLength = rs.size();
 			// Run the matcher
 			seqt.accept(this);
+			rs = (ResultSequence) ((Pair)_param)._two;
 			int lengthAfter = rs.size();
 		
 			if (sequenceLength != lengthAfter)
@@ -876,7 +964,7 @@
 		ResultSequence rs = (ResultSequence) taexp.left().accept(this);
 
 		SequenceType seqt = (SequenceType) taexp.right();
-		SeqType st = new SeqType(seqt, _dc, rs);
+		SeqType st = new SeqType(seqt, _sc, rs);
 
 		try {
 			st.match(rs);
@@ -933,29 +1021,27 @@
 				report_error(TypeError.invalid_type(null));
 		}
 
-		AnyType at = rs.first();
+		AnyType at = (AnyType) rs.item(0);
 
 		if (!(at instanceof AnyAtomicType))
 			report_error(TypeError.invalid_type(null));
 
 		AnyAtomicType aat = (AnyAtomicType) at;
-
 		QName type = st.type();
 
-		// check if constructor exists
-		// try {
-		if (!_dc.function_exists(type, 1))
-			report_error(TypeError.invalid_type(null));
-		/*
-		 * } catch(StaticNsNameError err) {
-		 * report_error(TypeError.invalid_type(null)); }
-		 */
 		// prepare args from function
 		Collection args = new ArrayList();
 		args.add(ResultSequenceFactory.create_new(aat));
 
 		try {
-			return _dc.evaluate_function(type, args);
+			Function function = cexp.function();
+			if (function == null) {
+				function = _sc.resolveFunction(type.asQName(), args.size());
+				cexp.set_function(function);
+			}
+			if (function == null)
+				report_error(TypeError.invalid_type(null));
+			return function.evaluate(args, _ec);
 		} catch (DynamicError err) {
 			report_error(err);
 			return null; // unreach
@@ -1011,13 +1097,13 @@
 	// [each time changing the context item].
 	private ResultSequence do_step(StepExpr se) {
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 		ArrayList results = new ArrayList();
 		int type = 0; // 0: don't know yet
 		// 1: atomic
 		// 2: node
 
-		Focus focus = _dc.focus();
+		Focus focus = focus();
 		int original_pos = focus.position();
 
 		// execute step for all items in focus
@@ -1028,7 +1114,7 @@
 			if (!focus.advance_cp())
 				break;
 		}
-
+		
 		// make sure we didn't change focus
 		focus.set_position(original_pos);
 
@@ -1074,50 +1160,40 @@
 				}
 			}
 		}
-
 		// XXX lame
 		if (node_types) {
-			rs = NodeType.eliminate_dups(rs);
-			rs = NodeType.sort_document_order(rs);
+			rs = NodeType.linarize(rs);
 		}
-
-		return rs;
+		return rs.getSequence();
 	}
 
 	private ResultSequence root_self_node() {
 		Axis axis = new SelfAxis();
-		ResultSequence rs;
+		ResultBuffer buffer = new ResultBuffer();
 
 		// XXX the cast!!!
-		rs = axis.iterate((NodeType) _dc.context_item(), _dc);
+		axis.iterate((NodeType) focus().context_item(), buffer, _dc.getLimitNode());
 
-		rs = kind_test(rs, NodeType.class);
+		ResultSequence rs = kind_test(buffer.getSequence(), NodeType.class);
 
-		try {
-			List records = new ArrayList();
-			records.add(rs);
-			rs = FnRoot.fn_root(records, _dc);
-		} catch (DynamicError err) {
-			report_error(err);
-		}
+		List records = new ArrayList();
+		records.add(rs);
+		rs = FnRoot.fn_root(records, _ec);
 		return rs;
 	}
 
 	private ResultSequence descendant_or_self_node(ResultSequence rs) {
-		ResultSequence res = ResultSequenceFactory.create_new();
+		ResultBuffer res = new ResultBuffer();
 		Axis axis = new DescendantOrSelfAxis();
 
 		// for all nodes, get descendant or self nodes
 		for (Iterator i = rs.iterator(); i.hasNext();) {
 			NodeType item = (NodeType) i.next();
 
-			ResultSequence nodes = axis.iterate(item, _dc);
-			nodes = kind_test(nodes, NodeType.class);
-
-			res.concat(nodes);
+			axis.iterate(item, res, _dc.getLimitNode());
 		}
 
-		return res;
+		return res.getSequence();
 	}
 
 	/**
@@ -1131,7 +1207,7 @@
 		XPathExpr xp = e;
 
 		ResultSequence rs = null;
-		Focus original_focus = _dc.focus();
+		Focus original_focus = focus();
 
 		// do all the steps
 		while (xp != null) {
@@ -1167,7 +1243,7 @@
 
 					// make result of previous step the new
 					// focus
-					_dc.set_focus(new Focus(rs));
+					set_focus(new Focus(rs));
 
 					// do the step for all item in context
 					rs = do_step(se);
@@ -1182,16 +1258,15 @@
 					// XXX ???
 					if (xp.slashes() == 1) {
 						rs = root_self_node();
-						_dc.set_focus(new Focus(rs));
+						set_focus(new Focus(rs));
 
 						rs = do_step(se);
 					} else if (xp.slashes() == 2) {
-						ResultSequence res = ResultSequenceFactory.create_new();
 						rs = root_self_node();
 
 						rs = descendant_or_self_node(rs);
 
-						_dc.set_focus(new Focus(rs));
+						set_focus(new Focus(rs));
 
 						rs = do_step(se);
 					} else
@@ -1209,7 +1284,7 @@
 		}
 
 		// restore focus
-		_dc.set_focus(original_focus);
+		set_focus(original_focus);
 
 		return rs;
 	}
@@ -1224,7 +1299,7 @@
 	public Object visit(ForwardStep e) {
 
 		// get context node
-		AnyType ci = _dc.context_item();
+		AnyType ci = focus().context_item();
 		
 		if (ci == null) 
 			report_error(DynamicError.contextUndefined());
@@ -1236,9 +1311,10 @@
 
 		// get the nodes on the axis
 		ForwardAxis axis = e.iterator();
-		ResultSequence nodes = axis.iterate(cn, _dc);
+		ResultBuffer rb = new ResultBuffer();
+		axis.iterate(cn, rb, _dc.getLimitNode());
 		// get all nodes in the axis, and principal node
-		Pair arg = new Pair(axis.principal_node_kind().string_type(), nodes);
+		Pair arg = new Pair(axis.principal_node_kind().string_type(), rb.getSequence());
 
 		// do the name test
 		_param = arg;
@@ -1257,7 +1333,7 @@
 	// XXX unify with top
 	public Object visit(ReverseStep e) {
 		// get context node
-		AnyType ci = _dc.context_item();
+		AnyType ci = focus().context_item();
 
 		if (!(ci instanceof NodeType))
 			report_error(TypeError.ci_not_node(ci.string_type()));
@@ -1266,19 +1342,19 @@
 
 		// get the nodes on the axis
 		ReverseAxis axis = e.iterator();
-
+		
+		ResultBuffer result = new ResultBuffer();
 		// short for "gimme da parent"
 		if (e.axis() == ReverseStep.DOTDOT) {
-			axis = new ParentAxis();
-
-			return kind_test(axis.iterate(cn, _dc), NodeType.class);
+			new ParentAxis().iterate(cn, result, _dc.getLimitNode());
+			return result.getSequence();
 		}
 
 		assert axis != null;
 
-		ResultSequence nodes = axis.iterate(cn, _dc);
+		axis.iterate(cn, result, null);
 		// get all nodes in the axis, and principal node
-		Pair arg = new Pair(axis.principal_node_kind().string_type(), nodes);
+		Pair arg = new Pair(axis.principal_node_kind().string_type(), result.getSequence());
 
 		// do the name test
 		_param = arg;
@@ -1304,10 +1380,10 @@
 		if (test_prefix == null && type.equals("element")) {
 			// XXX make a new copy
 			name = new QName(null, name.local());
-			name.set_namespace(_dc.default_namespace());
+			name.set_namespace(_sc.getDefaultNamespace());
 
 			// if we actually have a namespace, pretend we do =D
-			if (name.namespace() != null)
+			if (name.namespace() != null && name.namespace().length() > 0)
 				test_prefix = "";
 		}
 
@@ -1375,15 +1451,18 @@
 		String type = (String) arg._one;
 		ResultSequence rs = (ResultSequence) arg._two;
 
+		ResultBuffer rb = new ResultBuffer();
+		
 		for (Iterator i = rs.iterator(); i.hasNext();) {
 			NodeType nt = (NodeType) i.next();
 
 			// check if node passes name test
-			if (!name_test(nt, name, type))
-				i.remove();
-
+			if (name_test(nt, name, type))
+				rb.add(nt);
 		}
-
+		rs = rb.getSequence();
+		arg._two = rs;
+		
 		return rs;
 	}
 
@@ -1395,9 +1474,9 @@
 	 * @return a result sequence
 	 */
 	public Object visit(VarRef e) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
-		Object var = _dc.get_variable(e.name());
+		Object var = getVariable(e.name());
 
 		assert var != null;
 
@@ -1408,7 +1487,7 @@
 		   rs.concat((ResultSequence) var);	
 		}
 
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
@@ -1419,10 +1498,7 @@
 	 * @return a result sequence
 	 */
 	public Object visit(StringLiteral e) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(e.value());
-		return rs;
+		return e.value();
 	}
 
 	/**
@@ -1433,10 +1509,7 @@
 	 * @return a result sequence
 	 */
 	public Object visit(IntegerLiteral e) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(e.value());
-		return rs;
+		return e.value();
 	}
 
 	/**
@@ -1447,10 +1520,7 @@
 	 * @return a result sequence
 	 */
 	public Object visit(DoubleLiteral e) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(e.value());
-		return rs;
+		return e.value();
 	}
 
 	/**
@@ -1461,10 +1531,10 @@
 	 * @return a result sequence
 	 */
 	public Object visit(DecimalLiteral e) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		rs.add(e.value());
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
@@ -1486,14 +1556,14 @@
 	 * @return a result sequence
 	 */
 	public Object visit(CntxItemExpr e) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
-		AnyType contextItem = _dc.context_item();
+		AnyType contextItem = focus().context_item();
 		if (contextItem == null) {
 			report_error(DynamicError.contextUndefined());
 		}
 		rs.add(contextItem);
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
@@ -1509,12 +1579,16 @@
 		for (Iterator i = e.iterator(); i.hasNext();) {
 			Expr arg = (Expr) i.next();
 			// each argument will produce a result sequence
-			args.add(arg.accept(this));
+			args.add((ResultSequence)arg.accept(this));
 		}
 
 		try {
-			ResultSequence rs = _dc.evaluate_function(e.name(), args);
-			return rs;
+			Function function = e.function();
+			if (function == null) {
+				function = _sc.resolveFunction(e.name().asQName(), args.size());
+				e.set_function(function);
+			}
+			return function.evaluate(args, _ec);
 		} catch (DynamicError err) {
 			report_error(err);
 			return null; // unreach
@@ -1562,17 +1636,23 @@
 			break;
 		case ItemType.QNAME:
 
-			// try {
-			if (!_dc.type_defined(e.qname()))
-				report_error(new StaticTypeNameError("Type not defined: "
-						+ e.qname().string()));
+			boolean ok = false;
+			TypeModel model = _sc.getTypeModel();
+			if (model != null) {
+				ok = _sc.getTypeModel().lookupType(e.qname().namespace(), e.qname().local()) != null;
+			}
+			if (! ok ) {
+				ok = BuiltinTypeLibrary.BUILTIN_TYPES.lookupType(e.qname().namespace(), e.qname().local()) != null;
+			}
+			if (! ok) report_error(new StaticTypeNameError("Type not defined: "
+					+ e.qname().string()));
 			
 			ResultSequence arg = (ResultSequence) ((Pair) _param)._two;
-			item_test(arg, e.qname());
+			((Pair) _param)._two = item_test(arg, e.qname());
 			break;
 
 		case ItemType.KINDTEST:
-			e.kind_test().accept(this);
+			((Pair) _param)._two = e.kind_test().accept(this);
 			break;
 		}
 
@@ -1580,33 +1660,37 @@
 	}
 
 	private ResultSequence item_test(ResultSequence rs, QName qname) {
+		ResultBuffer rb = new ResultBuffer();
 		for (Iterator i = rs.iterator(); i.hasNext();) {
 			AnyType item = (AnyType) i.next();
 			
 			if (item instanceof NodeType) {
 				NodeType node = ((NodeType)item);
-				if (_dc.derives_from(node , qname)) continue;
-				// fall through => non-match
+				if (derivesFrom(node, qname)) rb.add(node);
 			} else {
 				// atomic of some sort
-				if (qname.equals(ANY_ATOMIC_TYPE)) continue; // match !
+				if (qname.equals(ANY_ATOMIC_TYPE)) {
+					rb.add(item);
+					continue; // match !
+				}
 				
-				final AnyAtomicType aat = _dc.make_atomic(qname);
-				if (aat.getClass().isInstance(item)) continue;
+				final AnyAtomicType aat = makeAtomic(qname);
+				if (aat.getClass().isInstance(item)) rb.add(item);
 				
 				// fall through => non-match
 			}
-			i.remove();
 		}
-		return rs;
+		return rb.getSequence();
 	}
 
     private ResultSequence kind_test(ResultSequence rs, Class kind) {
+    	ResultBuffer rb = new ResultBuffer();
 		for (Iterator i = rs.iterator(); i.hasNext();) {
-			if (!kind.isInstance(i.next()))
-				i.remove();
+			Item item = (Item) i.next();
+			if (kind.isInstance(item))
+				rb.add(item);
 		}
-		return rs;
+		return rb.getSequence();
 	}
 
 	/**
@@ -1658,7 +1742,7 @@
 					if (elem_count > 1)
 						break;
 
-					elem = new ElementType((Element) child, this._dc.getTypeModel(child));
+					elem = new ElementType((Element) child, _sc.getTypeModel());
 				}
 			}
 
@@ -1671,8 +1755,7 @@
 			assert elem != null;
 
 			// setup parameter for element test
-			ResultSequence res = ResultSequenceFactory.create_new();
-			res.add(elem);
+			ResultSequence res = new ResultBuffer.SingleResultSequence(elem);
 			_param = new Pair("element", res);
 
 			// do name test
@@ -1702,7 +1785,8 @@
 	public Object visit(TextTest e) {
 		ResultSequence arg = (ResultSequence) ((Pair) _param)._two;
 
-		return kind_test(arg, TextType.class);
+		((Pair) _param)._two = kind_test(arg, TextType.class);
+		return ((Pair) _param)._two;
 	}
 
 	/**
@@ -1734,6 +1818,7 @@
 		if (pit_arg == null)
 			return kind_test(arg, PIType.class);
 
+    	ResultBuffer rb = new ResultBuffer();
 		for (Iterator i = arg.iterator(); i.hasNext();) {
 			AnyType item = (AnyType) i.next();
 
@@ -1742,12 +1827,12 @@
 				PIType pi = (PIType) item;
 
 				// match target
-				if (!pit_arg.equals(pi.value().getTarget()))
-					i.remove();
-			} else
-				i.remove();
+				if (pit_arg.equals(pi.value().getTarget()))
+					rb.add(pi);
+			}
 		}
-
+		arg = rb.getSequence();
+		((Pair) _param)._two = arg;
 		return arg;
 	}
 
@@ -1763,29 +1848,28 @@
 		ResultSequence rs = kind_test((ResultSequence) ((Pair) _param)._two,
 				AttrType.class);
 
-		// match the name if it's not a wild card
+		ResultBuffer rb = new ResultBuffer();
+		
 		QName name = e.name();
-		if (name != null && !e.wild()) {
-			for (Iterator i = rs.iterator(); i.hasNext();) {
-				if (!name_test((NodeType) i.next(), name, "attribute"))
-
-					i.remove();
-			}
-		}
-
-		// match the type
 		QName type = e.type();
-		if (type != null) {
-			for (Iterator i = rs.iterator(); i.hasNext();) {
-				NodeType node = (NodeType) i.next();
 
-				// check if element derives from
-				if (!_dc.derives_from(node, type))
-					i.remove();
+		for (Iterator i = rs.iterator(); i.hasNext();) {
+			NodeType node = (NodeType) i.next();
+			// match the name if it's not a wild card
+			if (name != null && !e.wild()) {
+				if (!name_test(node, name, "attribute"))
+					continue;
 			}
+			// match the type
+			if (type != null) {
+				// check if element derives from
+				if (! derivesFrom(node, type))
+					continue;
+			}
+			rb.add(node);
 		}
-
-		return rs;
+		((Pair) _param)._two = rb.getSequence();
+		return ((Pair) _param)._two;
 	}
 
 	/**
@@ -1809,11 +1893,11 @@
 		}
 
 		// check the type
-		TypeDefinition et = _dc.attribute_type_definition(name);
+		TypeDefinition et = _sc.getTypeModel().lookupAttributeDeclaration(name.namespace(), name.local());
 		for (Iterator i = rs.iterator(); i.hasNext();) {
 			NodeType node = (NodeType) i.next();
 
-			if (!_dc.derives_from(node, et))
+			if (! derivesFrom(node, et))
 				i.remove();
 
 		}
@@ -1829,45 +1913,35 @@
 	 * @return a result sequence
 	 */
 	public Object visit(ElementTest e) {
-
 		// filter out all elements
 		ResultSequence rs = kind_test((ResultSequence) ((Pair) _param)._two,
 				ElementType.class);
 
 		// match the name if it's not a wild card
-		QName name = e.name();
-		if (name != null && !e.wild()) {
-			for (Iterator i = rs.iterator(); i.hasNext();) {
-				if (!name_test((ElementType) i.next(), name, "element"))
+		ResultBuffer rb = new ResultBuffer();
+		QName nameTest = e.name();
+		QName typeTest = e.type();
+		for (Iterator i = rs.iterator(); i.hasNext();) {
+			NodeType node = (NodeType) i.next();
 
-					i.remove();
+			if (nameTest != null && !e.wild()) {
+				// skip if there's a name test and the name does not match
+				if (!name_test((ElementType) node, nameTest, "element")) continue;
 			}
-		}
-
-		// match the type
-		QName type = e.type();
-		if (type != null) {
-			for (Iterator i = rs.iterator(); i.hasNext();) {
-				NodeType node = (NodeType) i.next();
-
+			if (typeTest != null) {
 				// check if element derives from
-				if (_dc.derives_from(node, type)) {
-					// nilled may be true or false
-					if (e.qmark()) {
-					}
-					// nilled has to be false
-					else {
-						XSBoolean nilled = (XSBoolean) node.nilled().first();
-						if (nilled.value())
-							i.remove();
-					}
-
-				} else
-					i.remove();
+				if (! derivesFrom(node, typeTest)) continue;
+				
+				// nilled may be true or false
+				if (! e.qmark()) {
+					XSBoolean nilled = (XSBoolean) node.nilled().first();
+					if (nilled.value()) continue;
+				}
 			}
+			rb.add(node);
 		}
-
-		return rs;
+		((Pair) _param)._two = rb.getSequence();
+		return ((Pair) _param)._two;
 	}
 
 	/**
@@ -1892,11 +1966,11 @@
 		}
 
 		// check the type
-		TypeDefinition et = _dc.element_type_definition(name);
+		TypeDefinition et = _sc.getTypeModel().lookupElementDeclaration(name.namespace(), name.local());
 		for (Iterator i = rs.iterator(); i.hasNext();) {
 			NodeType node = (NodeType) i.next();
 
-			if (!_dc.derives_from(node, et)) {
+			if (! derivesFrom(node, et)) {
 				i.remove();
 				continue;
 			}
@@ -1914,12 +1988,11 @@
 		// rule 1 of spec... if numeric type:
 		// if num eq position then true else false
 		if (rs.size() == 1) {
-			AnyType at = rs.get(0);
+			AnyType at = (AnyType) rs.item(0);
 
 			if (at instanceof NumericType) {
 				try {
-					_g_xsint.set_int(BigInteger.valueOf(_dc.context_position()));
-					return FsEq.fs_eq_fast(at, _g_xsint, _dc);
+					return FsEq.fs_eq_fast(at, new XSInteger(BigInteger.valueOf(focus().position())), _dc);
 				} catch (DynamicError err) {
 					report_error(err);
 
@@ -1938,9 +2011,9 @@
 
 	// do the predicate for all items in focus
 	private ResultSequence do_predicate(Collection exprs) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
-		Focus focus = _dc.focus();
+		Focus focus = focus();
 		int original_cp = focus.position();
 
 		// optimization
@@ -1962,7 +2035,7 @@
 							rs.add(focus.context_item());
 						}
 						focus.set_position(original_cp);
-						return rs;
+						return rs.getSequence();
 					}
 				}
 			}
@@ -1978,9 +2051,8 @@
 			// if predicate is true, the context item is definitely
 			// in the sequence
 			if (predicate_truth(res))
-				rs.add(_dc.context_item());
+				rs.add(focus().context_item());
 
-			res.release();
 			if (!focus.advance_cp())
 				break;
 
@@ -1989,7 +2061,7 @@
 		// restore
 		focus.set_position(original_cp);
 
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
@@ -2006,7 +2078,7 @@
 			return rs;
 
 		// I take it predicates are logical ANDS...
-		Focus original_focus = _dc.focus();
+		Focus original_focus = focus();
 
 		// go through all predicates
 		for (Iterator i = e.iterator(); i.hasNext();) {
@@ -2014,13 +2086,13 @@
 			if (rs.size() == 0)
 				break;
 
-			_dc.set_focus(new Focus(rs));
+			set_focus(new Focus(rs));
 			rs = do_predicate((Collection) i.next());
 
 		}
 
 		// restore focus [context switching ;D ]
-		_dc.set_focus(original_focus);
+		set_focus(original_focus);
 		return rs;
 	}
 
@@ -2040,20 +2112,21 @@
 		if (e.predicate_count() == 0)
 			return rs;
 
-		Focus original_focus = _dc.focus();
+		Focus original_focus = focus();
 
 		// go through all predicates
 		for (Iterator i = e.iterator(); i.hasNext();) {
 			if (rs.size() == 0)
 				break;
 
-			_dc.set_focus(new Focus(rs));
+			set_focus(new Focus(rs));
 			rs = do_predicate((Collection) i.next());
 
 		}
 
 		// restore focus [context switching ;D ]
-		_dc.set_focus(original_focus);
+		set_focus(original_focus);
 		return rs;
 	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicContext.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicContext.java
index 20ab937..e30cbbe 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicContext.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
  *     Jesper Moller- bug 280555 - Add pluggable collation support
  *     Mukul Gandhi - bug 325262 - providing ability to store an XPath2 sequence into
  *                                 an user-defined variable.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
@@ -170,7 +171,7 @@
 	 * @return A Jaa collator, or null, if no such Collator exists 
 	 * @since 1.1
 	 */
-	public Comparator<Object> get_collation(String uri); 
+	public Comparator get_collation(String uri); 
 	
 	/**
 	 * Returns the current default collator
@@ -184,7 +185,6 @@
 	/**
 	 * @deprecated
 	 */
-	@Deprecated
 	public int node_position(Node node);
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicError.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicError.java
index d704cae..eaebfca 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicError.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DynamicError.java
@@ -15,6 +15,7 @@
  *     Jesper Steen Moller  - bug 280555 - Add pluggable collation support
  *     Jesper Steen Moller  - bug 262765 - Add FORG0006
  *     Jesper Steen Moller  - bug 290337 - Revisit use of ICU
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
@@ -108,9 +109,9 @@
 	 * @return the DynamicError.
 	 * @since 1.1
 	 */
-	public static DynamicError argument_type_error(Class<?> type) {
+	public static DynamicError argument_type_error(Class type) {
 		return new DynamicError("FORG0006", type != null ?
-				"Invalid argument type :" + type.getSimpleName() : "Invalid argument type");
+				"Invalid argument type :" + type.getName() : "Invalid argument type");
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/Engine.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/Engine.java
new file mode 100644
index 0000000..a15f9a0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/Engine.java
@@ -0,0 +1,33 @@
+package org.eclipse.wst.xml.xpath2.processor;
+
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.XPath2Engine;
+import org.eclipse.wst.xml.xpath2.api.XPath2Expression;
+import org.eclipse.wst.xml.xpath2.processor.ast.XPath;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.FnBoolean;
+
+/**
+ * @since 2.0
+ */
+public class Engine implements XPath2Engine {
+
+	public XPath2Expression parseExpression(String expression, StaticContext context) {
+
+		XPath xPath = new JFlexCupParser().parse(expression);
+		xPath.setStaticContext(context);
+		StaticNameResolver name_check = new StaticNameResolver(context);
+		name_check.check(xPath);
+		
+		xPath.setAxes(name_check.getAxes());
+		xPath.setFreeVariables(name_check.getFreeVariables());
+		xPath.setResolvedFunctions(name_check.getResolvedFunctions());
+		xPath.setRootUsed(name_check.isRootUsed());
+		
+		return xPath;
+	}
+
+	boolean effectiveBooleanValue(ResultSequence rs) {
+		return FnBoolean.fn_boolean(rs).value();
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/JFlexCupParser.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/JFlexCupParser.java
index c152caf..165864c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/JFlexCupParser.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/JFlexCupParser.java
@@ -48,6 +48,8 @@
 			throw new XPathParserException("JFlex lexer error: " + e.reason());
 		} catch (CupError e) {
 			throw new XPathParserException("CUP parser error: " + e.reason());
+		} catch (StaticError e) {
+			throw e;
 		} catch (Exception e) {
 			String err = "Unknown error at line " + lexer.lineno();
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ResultSequence.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ResultSequence.java
index eb59fa1..0ab57c3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ResultSequence.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ResultSequence.java
@@ -11,14 +11,20 @@
 
 package org.eclipse.wst.xml.xpath2.processor;
 
-import java.util.*;
+import java.util.Iterator;
+import java.util.ListIterator;
 
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Interface to the methods of range of result sequence
+ * @deprecated Use org.eclipse.wst.xml.xpath2.api.ResultSequence instead
  */
-public abstract class ResultSequence {
+public abstract class ResultSequence implements org.eclipse.wst.xml.xpath2.api.ResultSequence {
 
 	/**
 	 * add item
@@ -105,7 +111,7 @@
 
 			buf.append(elem.string_type() + ": ");
 
-			String value = elem.string_value();
+			String value = elem.getStringValue();
 
 			if (elem instanceof NodeType) {
 				QName tmp = ((NodeType) elem).node_name();
@@ -129,4 +135,25 @@
 	public void release() {
 		ResultSequenceFactory.release(this);
 	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public Item item(int index) {
+		return get(index);
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public ItemType itemType(int index) {
+		return get(index).getItemType();
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public Object value(int index) {
+		return get(index).getNativeValue();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticContext.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticContext.java
index dd4825f..093d14b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticContext.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,11 +8,11 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver (STAR) - bug 262765 - add ability to set the base uri 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
 
-import java.util.List;
 import java.util.Map;
 
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
@@ -22,7 +22,6 @@
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
-import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
 /**
@@ -261,13 +260,20 @@
 	
 	/**
 	 * @since 1.1
+	 * 
+	 * Gets the collections map, which maps a String into a List of Document, in
+	 * Java5 it would be <code>Map<String, List<Document>></code>
+	 * 
 	 */
-	public Map<String, List<Document>> get_collections();
+	public Map get_collections();
 	
 	/**
 	 * @since 1.1
+	 * 
+	 * Sets the collections map, which maps a String into a List of Document, in
+	 * Java5 it would be <code>Map<String, List<Document>></code>
 	 */
-	public void set_collections(Map<String, List<Document>> collections);
+	public void set_collections(Map collections);
 
 	/**
 	 * Gets the type provider in use for the specified DOM node.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticNameResolver.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticNameResolver.java
index d1c23d2..0e56fbb 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticNameResolver.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/StaticNameResolver.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,22 +7,92 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *     Jesper Steen Moller - bug 343804 - Updated API information
+ *     Jesper Steen Moller - bug 343804 - Updated API information
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
 
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.xml.XMLConstants;
+
+import org.eclipse.wst.xml.xpath2.api.Function;
 import org.eclipse.wst.xml.xpath2.processor.ast.XPath;
+import org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticAttrNameError;
+import org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticElemNameError;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticFunctNameError;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticNameError;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticNsNameError;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticTypeNameError;
 import org.eclipse.wst.xml.xpath2.processor.internal.StaticVarNameError;
-import org.eclipse.wst.xml.xpath2.processor.internal.ast.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AddExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AndExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CastableExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CmpExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CntxItemExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DecimalLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DivExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DoubleLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ExceptExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.Expr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ForExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ForwardStep;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IDivExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IfExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.InstOfExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IntegerLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IntersectExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.MinusExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ModExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.MulExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.NameTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.NodeTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.OrExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ParExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.PipeExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.PlusExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.QuantifiedExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.RangeExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ReverseStep;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.StepExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.StringLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SubExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.TreatAsExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.UnExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.UnionExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.VarExprPair;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.VarRef;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * This class resolves static names.
@@ -36,29 +106,162 @@
 		private static final long serialVersionUID = 3898564402981741950L;
 	}
 
-	private StaticContext _sc;
+	private org.eclipse.wst.xml.xpath2.api.StaticContext _sc;
 	private StaticNameError _err;
-
+	
+	private Set<javax.xml.namespace.QName> _resolvedFunctions = new HashSet<javax.xml.namespace.QName>();
+	private Set<String> _axes = new HashSet<String>();
+	private Set<javax.xml.namespace.QName> _freeVariables = new HashSet<javax.xml.namespace.QName>();
 	/**
 	 * Constructor for static name resolver
 	 * 
 	 * @param sc
 	 *            is the static context.
+	 * @since 2.0
 	 */
-	public StaticNameResolver(StaticContext sc) {
-		_sc = sc;
+	public StaticNameResolver(final org.eclipse.wst.xml.xpath2.processor.StaticContext sc) {
+		_sc = new StaticContextAdapter(sc);
 		_err = null;
 	}
 
+	/**
+	 * @since 2.0
+	 */
+	public StaticNameResolver(org.eclipse.wst.xml.xpath2.api.StaticContext context) {
+		_sc = context;
+		_err = null;
+	}
+
+	class VariableScope {
+		public VariableScope(QName name, org.eclipse.wst.xml.xpath2.api.typesystem.ItemType typeDef, VariableScope nextScope) {
+			this.name = name;
+			this.typeDef = typeDef;
+			this.nextScope = nextScope;
+		}
+		final public QName name;
+		final public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType typeDef;
+		final public VariableScope nextScope; 
+	}	
+	
+	/**
+	 * @since 2.0
+	 */
+	public Set<String> getAxes() {
+		return _axes;
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public Set<javax.xml.namespace.QName> getFreeVariables() {
+		return _freeVariables;
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public Set<javax.xml.namespace.QName> getResolvedFunctions() {
+		return _resolvedFunctions;
+	}
+	
+	private VariableScope _innerScope = null;
+	private boolean _rootUsed;
+
+	private org.eclipse.wst.xml.xpath2.api.typesystem.ItemType getVariableType(QName name) {
+		VariableScope scope = _innerScope;
+		while (scope != null) {
+			if (name.equals(scope.name)) return scope.typeDef;
+			scope = scope.nextScope;
+		}
+		return _sc.getInScopeVariables().getVariableType(name.asQName());
+	}
+
+	private boolean isVariableCaptured(QName name) {
+		VariableScope scope = _innerScope;
+		while (scope != null) {
+			if (name.equals(scope.name)) return true;
+			scope = scope.nextScope;
+		}
+		return false;
+	}
+
+	private boolean isVariableInScope(QName name) {
+		return isVariableCaptured(name) || _sc.getInScopeVariables().isVariablePresent(name.asQName());
+	}
+	
+	private void popScope() {
+		if (_innerScope == null) throw new IllegalStateException("Unmatched scope pop");
+		_innerScope = _innerScope.nextScope;
+	}
+
+	private void pushScope(QName var, BuiltinTypeDefinition xsAnytype) {
+		_innerScope = new VariableScope(var, new SimpleAtomicItemTypeImpl(xsAnytype), _innerScope);		
+	}
+ 
+	private boolean expandQName(QName name, String def, boolean allowWildcards) {
+		String prefix = name.prefix();
+
+		if ("*".equals(prefix)) {
+			if (! allowWildcards)
+				return false;
+			name.set_namespace("*");
+			return true;
+		}
+
+		if (prefix == null || XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
+			name.set_namespace(def);
+			return true;
+		}
+
+		// At this point, we know we have a non-null prefix, so look it up
+		String namespaceURI = _sc.getNamespaceContext().getNamespaceURI(prefix);
+		if (XMLConstants.NULL_NS_URI.equals(namespaceURI))
+			return false;
+
+		name.set_namespace(namespaceURI);
+		return true;
+	}
+
+	private boolean expandItemQName(QName name) {
+		return expandQName(name, _sc.getDefaultNamespace(), true);
+	}
+
+	private boolean expandVarQName(QName name) {
+		return expandQName(name, _sc.getDefaultNamespace(), false);
+	}
+
+	/**
+	 * Expands a qname and uses the default function namespace if unprefixed.
+	 * 
+	 * @param name
+	 *            qname to expand.
+	 * @return true on success.
+	 */
+	private boolean expandFunctionQName(QName name) {
+		return expandQName(name, _sc.getDefaultFunctionNamespace(), false);
+	}
+
+	/**
+	 * Expands a qname and uses the default type/element namespace if
+	 * unprefixed.
+	 * 
+	 * @param name
+	 *            qname to expand.
+	 * @return true on success.
+	 */
+	private boolean expandItemTypeQName(QName name) {
+		return expandQName(name, _sc.getDefaultNamespace(), false);
+	}
+	
 	// the problem is that visistor interface does not throw exceptions...
 	// so we get around it ;D
-	private void report_error(StaticNameError err) {
+	private void reportError(StaticNameError err) {
 		_err = err;
 		throw new DummyError();
 	}
 
-	private void report_bad_prefix(String prefix) {
-		report_error(StaticNsNameError.unknown_prefix(prefix));
+	private void reportBadPrefix(String prefix) {
+		reportError(StaticNsNameError.unknown_prefix(prefix));
 	}
 
 	/**
@@ -104,25 +307,22 @@
 			VarExprPair pair = (VarExprPair) iter.next();
 
 			QName var = pair.varname();
-			if (!_sc.expand_qname(var))
-				report_bad_prefix(var.prefix());
+			if (!expandVarQName(var))
+				reportBadPrefix(var.prefix());
 
 			Expr e = pair.expr();
 
 			e.accept(this);
 
-			_sc.new_scope();
+			pushScope(var, BuiltinTypeLibrary.XS_ANYTYPE);
 			scopes++;
-			_sc.add_variable(var);
 		}
 
-		_sc.new_scope();
-		scopes++;
 		expr.accept(this);
 
 		// kill the scopes
 		for (int i = 0; i < scopes; i++)
-			_sc.destroy_scope();
+			popScope();
 	}
 
 	/**
@@ -153,7 +353,7 @@
 		return null;
 	}
 
-	private void printExprs(Iterator i) {
+	private void visitExprs(Iterator i) {
 		while (i.hasNext()) {
 			Expr e = (Expr) i.next();
 
@@ -170,7 +370,7 @@
 	 */
 	public Object visit(IfExpr ifex) {
 
-		printExprs(ifex.iterator());
+		visitExprs(ifex.iterator());
 
 		ifex.then_clause().accept(this);
 
@@ -405,6 +605,18 @@
 	 */
 	public Object visit(CastExpr cexp) {
 		printBinExpr("CAST", cexp);
+		
+		SingleType st = (SingleType) cexp.right();
+		QName type = st.type();
+		
+		javax.xml.namespace.QName qName = type.asQName();
+		Function f = _sc.resolveFunction(qName, 1);
+		if (f == null)
+			reportError(new StaticFunctNameError("Type does not exist: "
+					+ type.toString()));
+		cexp.set_function(f);
+		_resolvedFunctions.add(qName);
+
 		return null;
 	}
 
@@ -454,8 +666,13 @@
 	 */
 	public Object visit(XPathExpr e) {
 		XPathExpr xp = e;
-
+		boolean firstStep = true;
+		
 		while (xp != null) {
+			if (firstStep && xp.slashes() != 0)
+				_rootUsed = true;
+			
+			firstStep = false;
 			StepExpr se = xp.expr();
 
 			if (se != null)
@@ -476,6 +693,8 @@
 	public Object visit(ForwardStep e) {
 		e.node_test().accept(this);
 
+		_axes.add(e.iterator().name());
+		
 		return null;
 	}
 
@@ -491,6 +710,10 @@
 		NodeTest nt = e.node_test();
 		if (nt != null)
 			nt.accept(this);
+		
+		ReverseAxis iterator = e.iterator();
+		if (iterator != null)
+			_axes.add(iterator.name());
 
 		return null;
 	}
@@ -505,8 +728,8 @@
 	public Object visit(NameTest e) {
 		QName name = e.name();
 
-		if (!_sc.expand_qname(name))
-			report_bad_prefix(name.prefix());
+		if (!expandItemQName(name))
+			reportBadPrefix(name.prefix());
 
 		return null;
 	}
@@ -520,12 +743,19 @@
 	 */
 	public Object visit(VarRef e) {
 		QName var = e.name();
-		if (!_sc.expand_qname(var))
-			report_bad_prefix(var.prefix());
+		
+		if (!expandVarQName(var))
+			reportBadPrefix(var.prefix());
 
-		if (!_sc.variable_in_scope(var))
-			report_error(new StaticVarNameError("Variable not in scope: "
-					+ var.string()));
+		if (! isVariableInScope(var))
+			reportError(new StaticNameError(StaticNameError.NAME_NOT_FOUND));
+		
+		if (getVariableType(var) == null)
+			reportError(new StaticNameError(StaticNameError.NAME_NOT_FOUND));
+
+		// The variable is good. If it was not captured, it must be referring to an external var
+		if (! isVariableCaptured(var)) _freeVariables.add(var.asQName());
+		
 		return null;
 	}
 
@@ -581,7 +811,7 @@
 	 * @return null.
 	 */
 	public Object visit(ParExpr e) {
-		printExprs(e.iterator());
+		visitExprs(e.iterator());
 		return null;
 	}
 
@@ -606,14 +836,18 @@
 	public Object visit(FunctionCall e) {
 		QName name = e.name();
 
-		if (!_sc.expand_function_qname(name))
-			report_bad_prefix(name.prefix());
+		if (!expandFunctionQName(name))
+			reportBadPrefix(name.prefix());
 
-		if (!_sc.function_exists(name, e.arity()))
-			report_error(new StaticFunctNameError("Function does not exist: "
+		javax.xml.namespace.QName qName = name.asQName();
+		Function f = _sc.resolveFunction(qName, e.arity());
+		if (f == null)
+			reportError(new StaticFunctNameError("Function does not exist: "
 					+ name.string() + " arity: " + e.arity()));
-
-		printExprs(e.iterator());
+		e.set_function(f);
+		_resolvedFunctions.add(qName);
+		
+		visitExprs(e.iterator());
 		return null;
 	}
 
@@ -626,8 +860,8 @@
 	 */
 	public Object visit(SingleType e) {
 		QName type = e.type();
-		if (!_sc.expand_elem_type_qname(type))
-			report_bad_prefix(type.prefix());
+		if (!expandItemTypeQName(type))
+			reportBadPrefix(type.prefix());
 
 		return null;
 	}
@@ -662,12 +896,14 @@
 			break;
 		case ItemType.QNAME:
 			QName type = e.qname();
-			if (!_sc.expand_elem_type_qname(type))
-				report_bad_prefix(type.prefix());
+			if (!expandItemTypeQName(type))
+				reportBadPrefix(type.prefix());
 
-			if (!_sc.type_defined(e.qname()))
-				report_error(new StaticTypeNameError("Type not defined: "
-						+ e.qname().string()));
+			if (BuiltinTypeLibrary.BUILTIN_TYPES.lookupType(e.qname().namespace(), e.qname().local()) == null) {
+				if (_sc.getTypeModel() == null || _sc.getTypeModel().lookupType(e.qname().namespace(), e.qname().local()) == null)
+					reportError(new StaticTypeNameError("Type not defined: "
+							+ e.qname().string()));
+			}
 			break;
 
 		case ItemType.KINDTEST:
@@ -757,20 +993,16 @@
 	// XXX NO CHECK ?
 	public Object visit(AttributeTest e) {
 		QName name = e.name();
-
-		if (name == null)
-			return null;
-
-		if (!_sc.expand_qname(name))
-			report_bad_prefix(name.prefix());
-
+		if (name != null) {
+			if (!expandItemQName(name))
+				reportBadPrefix(name.prefix());
+		}
+		
 		name = e.type();
-		if (name == null)
-			return null;
-
-		if (!_sc.expand_elem_type_qname(name))
-			report_bad_prefix(name.prefix());
-
+		if (name != null) {
+			if (!expandItemTypeQName(name))
+				reportBadPrefix(name.prefix());
+		}
 		return null;
 	}
 
@@ -784,11 +1016,11 @@
 	public Object visit(SchemaAttrTest e) {
 		QName name = e.arg();
 
-		if (!_sc.expand_qname(name))
-			report_bad_prefix(name.prefix());
+		if (!expandItemQName(name))
+			reportBadPrefix(name.prefix());
 
-		if (!_sc.attribute_declared(name))
-			report_error(new StaticAttrNameError("Attribute not decleared: "
+		if (_sc.getTypeModel().lookupAttributeDeclaration(name.namespace(), name.local()) == null)
+			reportError(new StaticAttrNameError("Attribute not decleared: "
 					+ name.string()));
 
 		return null;
@@ -803,21 +1035,15 @@
 	 */
 	// XXX NO SEMANTIC CHECK?!
 	public Object visit(ElementTest e) {
-		QName name = e.name();
-
-		if (name == null)
-			return null;
-
-		if (!_sc.expand_elem_type_qname(name))
-			report_bad_prefix(name.prefix());
-
-		name = e.type();
-		if (name == null)
-			return null;
-
-		if (!_sc.expand_elem_type_qname(name))
-			report_bad_prefix(name.prefix());
-
+		if (e.name() != null) {
+			if (!expandItemTypeQName(e.name()))
+				reportBadPrefix(e.name().prefix());
+		}
+		
+		if (e.type() != null) {
+			if (!expandItemTypeQName(e.type()))
+				reportBadPrefix(e.type().prefix());
+		}
 		return null;
 	}
 
@@ -831,20 +1057,20 @@
 	public Object visit(SchemaElemTest e) {
 		QName elem = e.name();
 
-		if (!_sc.expand_elem_type_qname(elem))
-			report_bad_prefix(elem.prefix());
+		if (!expandItemQName(elem))
+			reportBadPrefix(elem.prefix());
 
-		if (!_sc.element_declared(elem))
-			report_error(new StaticElemNameError("Element not declared: "
+		if (_sc.getTypeModel().lookupElementDeclaration(elem.namespace(), elem.local()) == null)
+			reportError(new StaticElemNameError("Element not declared: "
 					+ elem.string()));
 		return null;
 	}
 
-	private void printCollExprs(Iterator i) {
+	private void visitCollExprs(Iterator i) {
 		while (i.hasNext()) {
 			Collection exprs = (Collection) i.next();
 
-			printExprs(exprs.iterator());
+			visitExprs(exprs.iterator());
 		}
 	}
 
@@ -859,7 +1085,7 @@
 
 		e.step().accept(this);
 
-		printCollExprs(e.iterator());
+		visitCollExprs(e.iterator());
 		return null;
 	}
 
@@ -873,7 +1099,14 @@
 	public Object visit(FilterExpr e) {
 		e.primary().accept(this);
 
-		printCollExprs(e.iterator());
+		visitCollExprs(e.iterator());
 		return null;
 	}
+
+	/**
+	 * @since 2.0
+	 */
+	public boolean isRootUsed() {
+		return _rootUsed;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XPathException.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XPathException.java
index 2d592f0..2464e8c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XPathException.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XPathException.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moller  - bug 290337 - Revisit use of ICU
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
@@ -15,7 +16,7 @@
 /**
  * This exception is thrown when there is a problem with an XPath exception.
  */
-public class XPathException extends Exception {
+public class XPathException extends RuntimeException {
 	/**
 	 * 
 	 */
@@ -41,7 +42,6 @@
 		return _reason;
 	}
 	
-	@Override
 	public String getMessage() {
 		return _reason;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XercesLoader.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XercesLoader.java
index 8944494..ba576c7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XercesLoader.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/XercesLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
  *     Jesper Steen Moller - Fixed namespace awareness
  *     David Carver  - bug 281186 - implementation of fn:id and fn:idref.  Correct
  *                                  loading of grammars if non-validating.
+ *     Mukul Gandhi - bug 280798 -  PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor;
@@ -84,8 +85,8 @@
 		factory.setNamespaceAware(true);
 		factory.setAttribute(SCHEMA_VALIDATION_FEATURE,
 				Boolean.valueOf(_validating));
-		factory.setAttribute(LOAD_EXTERNAL_DTD_FEATURE, true);
-		factory.setAttribute(NONVALIDATING_LOAD_DTD_GRAMMAR, true);
+		factory.setAttribute(LOAD_EXTERNAL_DTD_FEATURE, Boolean.TRUE);
+		factory.setAttribute(NONVALIDATING_LOAD_DTD_GRAMMAR, Boolean.TRUE);
 		factory.setAttribute(DOCUMENT_IMPLEMENTATION_PROPERTY,
 				DOCUMENT_PSVI_IMPLEMENTATION);
 		
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ast/XPath.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ast/XPath.java
index 9ef7b1b..9672d18 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ast/XPath.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ast/XPath.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,20 +7,37 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.ast;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.Iterator;
 
+import javax.xml.namespace.QName;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.XPath2Expression;
+import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator;
 import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode;
 import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor;
 
 /**
  * Support for XPath.
+ * 
+ * @deprecated This is only for internal use, use XPath2Expression instead
  */
-public class XPath extends XPathNode {
+public class XPath extends XPathNode implements XPath2Expression {
 	private Collection _exprs;
+	private StaticContext _staticContext;
+	private Collection<QName> _resolvedFunctions;
+	private Collection<String> _axes;
+	private Collection<QName> _freeVariables;
+	private boolean _rootUsed;
 
 	/**
 	 * Constructor for XPath.
@@ -37,7 +54,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
@@ -50,4 +66,83 @@
 	public Iterator iterator() {
 		return _exprs.iterator();
 	}
+
+	/**
+	 * @since 2.0
+	 */
+	public Collection<QName> getFreeVariables() {
+		return _freeVariables;
+	}
+
+	/**
+	 * @since 2.0
+	 */
+	public void setFreeVariables(Collection<QName> _freeVariables) {
+		this._freeVariables = _freeVariables;
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public Collection<QName> getResolvedFunctions() {
+		return _resolvedFunctions;
+	}
+
+	/**
+	 * @since 2.0
+	 */
+	public void setResolvedFunctions(Collection<QName> _resolvedFunctions) {
+		this._resolvedFunctions = _resolvedFunctions;
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public Collection<String> getAxes() {
+		return _axes;
+	}
+
+	/**
+	 * @since 2.0
+	 */
+	public void setAxes(Collection<String> _axes) {
+		this._axes = _axes;
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public boolean isRootPathUsed() {
+		return _rootUsed;
+	}
+
+	/**
+	 * @since 2.0
+	 */
+	public void setRootUsed(boolean _rootUsed) {
+		this._rootUsed = _rootUsed;
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public ResultSequence evaluate(DynamicContext dynamicContext, Object[] contextItems) {
+		if (_staticContext == null) throw new IllegalStateException("Static Context not set yet!");
+		return new DefaultEvaluator(_staticContext, dynamicContext, contextItems).evaluate2(this);
+	}
+	
+	/**
+	 * @since 2.0
+	 */
+	public StaticContext getStaticContext() {
+		return _staticContext;
+	}
+
+	/**
+	 * @since 2.0
+	 */
+	public void setStaticContext(StaticContext context) {
+		if (_staticContext != null) throw new IllegalStateException("Static Context already set!");
+		this._staticContext = context;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/function/XSCtrLibrary.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/function/XSCtrLibrary.java
index 282c1c6..7c4517c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/function/XSCtrLibrary.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/function/XSCtrLibrary.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,6 +32,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.function;
 
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.ConstructorFL;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
 
@@ -62,12 +64,25 @@
 		add_type(new XSNotation());
 
 		add_abstract_type("anyAtomicType", new AnyAtomicType() {
-			@Override
+
 			public String string_type() {
 				return null;
 			}
+
+			public String getStringValue() {
+				return null;
+			}
+			
+			public TypeDefinition getTypeDefinition() {
+				return null;
+			}
+
+			public ItemType sequenceType() {
+				return null;
+			}
+
 			@Override
-			public String string_value() {
+			public Object getNativeValue() {
 				return null;
 			}
 		});
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorAxis.java
index 219b98c..c620911 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorAxis.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,13 +7,14 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * Returns the ancestors of the context node, this always includes the root
@@ -26,29 +27,27 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The nodes that are ancestors of the context node.
 	 */
 	// XXX unify this with descendants axis ?
-	@Override
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
 
+		if (limitNode != null && limitNode.isSameNode(node.node_value())) return;
+		
+		int before = copyInto.size();
 		// get the parent
-		ResultSequence rs = super.iterate(node, dc);
+		super.iterate(node, copyInto, limitNode);
 
 		// no parent
-		if (rs.size() == 0)
-			return rs;
+		if (copyInto.size() == before)
+			return;
 
-		NodeType parent = (NodeType) rs.get(0);
+		NodeType parent = (NodeType) copyInto.item(before);
 
 		// get ancestors of parent
-		ResultSequence ances = iterate(parent, dc);
-
-		ances.concat(rs);
-
-		return ances;
+		iterate(parent, copyInto, limitNode);
 	}
 
+	public String name() {
+		return "ancestor";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorOrSelfAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorOrSelfAxis.java
index b12db23..5ca6c97 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorOrSelfAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AncestorOrSelfAxis.java
@@ -11,9 +11,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * The ancestor-or-self axis contains the context node and the ancestors of the
@@ -27,19 +27,17 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The context node and its ancestors.
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
 		// get ancestors
 		AncestorAxis aa = new AncestorAxis();
-		ResultSequence rs = aa.iterate(node, dc);
+		aa.iterate(node, copyInto, null);
 
 		// add self
-		rs.add(node);
-
-		return rs;
+		copyInto.add(node);
 	}
 
+	public String name() {
+		return "ancestor-or-self";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AttributeAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AttributeAxis.java
index 37baccc..9c10758 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AttributeAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/AttributeAxis.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,15 +8,18 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Moller - bug 275610 - Avoid big time and memory overhead for externals
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.w3c.dom.*;
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
 
 /**
  * The attribute axis contains the attributes of the context node. The axis will
@@ -29,16 +32,11 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The attibutes of the context node.
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
 		// only elements have attributes
 		if (!(node instanceof ElementType))
-			return rs;
+			return;
 
 		// get attributes
 		ElementType elem = (ElementType) node;
@@ -48,11 +46,8 @@
 		for (int i = 0; i < attrs.getLength(); i++) {
 			Attr attr = (Attr) attrs.item(i);
 
-			rs.add(NodeType.dom_to_xpath(attr, dc.getTypeModel(attr)));
+			copyInto.add(NodeType.dom_to_xpath(attr, node.getTypeModel()));
 		}
-
-		return rs;
-
 	}
 
 	/**
@@ -60,9 +55,11 @@
 	 * 
 	 * @return The type of node.
 	 */
-	@Override
 	public NodeType principal_node_kind() {
 		return new AttrType();
 	}
 
+	public String name() {
+		return "attribute";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Axis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Axis.java
index 96ce8b6..c34b748 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Axis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Axis.java
@@ -11,9 +11,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * This is the interface class for an Axis.
@@ -27,11 +27,10 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The result sequence.
+	 * @param copyInto TODO
+	 * @param limitNode TODO
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc);
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode);
 
 	/**
 	 * Get the principle kind of node.
@@ -39,4 +38,11 @@
 	 * @return The principle node kind.
 	 */
 	public NodeType principal_node_kind();
+	
+	/**
+	 * Returns the title of the sequence as it appears in the XPath source
+	 * 
+	 * @return Axis title
+	 */
+	public String name();
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ChildAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ChildAxis.java
index 4bbc1dc..a657cc4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ChildAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ChildAxis.java
@@ -13,11 +13,12 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.w3c.dom.*;
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.DocType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
  * The child axis contains the children of the context node.
@@ -29,15 +30,14 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The context node's children.
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
+		addChildren(node, copyInto, false);
+	}
+
+	protected void addChildren(NodeType node, ResultBuffer copyInto, boolean recurse) {
 		NodeList nl = null;
 		
-
 		// only document and element nodes have children
 		if (node instanceof DocType) {
 			nl = ((DocType) node).value().getChildNodes();
@@ -49,12 +49,15 @@
 		if (nl != null) {
 			for (int i = 0; i < nl.getLength(); i++) {
 				Node dnode = nl.item(i);
-				NodeType n = NodeType.dom_to_xpath(dnode, dc.getTypeModel(dnode));
-				rs.add(n);
+				NodeType n = NodeType.dom_to_xpath(dnode, node.getTypeModel());
+				copyInto.add(n);
+				
+				if (recurse) addChildren(n, copyInto, recurse);
 			}
 		}
-
-		return rs;
 	}
-
+	
+	public String name() {
+		return "child";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultRSFactory.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultRSFactory.java
index cb5b89c..2cb34ae 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultRSFactory.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultRSFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
@@ -37,7 +38,6 @@
 		_head_pos = POOL_SIZE - 1;
 	}
 
-	@Override
 	protected ResultSequence fact_create_new() {
 		if (_head_pos > 0) {
 			return _rs_pool[_head_pos--];
@@ -46,7 +46,6 @@
 		return _rs_creator.create_new();
 	}
 
-	@Override
 	protected void fact_release(ResultSequence rs) {
 		int new_pos = _head_pos + 1;
 
@@ -58,7 +57,6 @@
 		}
 	}
 
-	@Override
 	protected void fact_print_debug() {
 		System.out.println("Head pos: " + _head_pos);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultResultSequence.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultResultSequence.java
index 4838f56..aef408a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultResultSequence.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultResultSequence.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,26 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
 
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * Default implementation of a result sequence.
- * 
+ * @deprecated use ResultBuffer instead
  */
 public class DefaultResultSequence extends ResultSequence {
 
@@ -46,7 +54,6 @@
 	 * @param item
 	 *            is added to array _seq
 	 */
-	@Override
 	public void add(AnyType item) {
 		assert item != null;
 		_seq.add(item);
@@ -56,7 +63,6 @@
 	 * @param rs
 	 *            ResultSequence
 	 */
-	@Override
 	public void concat(ResultSequence rs) {
 		for (Iterator i = rs.iterator(); i.hasNext();)
 			_seq.add(i.next());
@@ -65,7 +71,6 @@
 	/**
 	 * @return the next iteration of array _seq
 	 */
-	@Override
 	public ListIterator iterator() {
 		return _seq.listIterator();
 	}
@@ -73,7 +78,6 @@
 	/**
 	 * @return integer of the size of array _seq
 	 */
-	@Override
 	public int size() {
 		return _seq.size();
 	}
@@ -83,7 +87,6 @@
 	 *            is the position of the array item that is wanted.
 	 * @return item i from array _seq
 	 */
-	@Override
 	public AnyType get(int i) {
 		return (AnyType) _seq.get(i);
 	}
@@ -91,7 +94,6 @@
 	/**
 	 * @return first item from array _seq
 	 */
-	@Override
 	public AnyType first() {
 		if (_seq.size() == 0)
 			return null;
@@ -100,19 +102,28 @@
 	}
 
 	/**
+	 * @return first item from array _seq
+	 */
+	public Object firstValue() {
+		return get(0).getNativeValue();
+	}
+
+	/**
 	 * Whether or not array _seq is empty
 	 * 
 	 * @return a boolean
 	 */
-	@Override
 	public boolean empty() {
 		return _seq.isEmpty();
 	}
 
+	public ItemType sequenceType() {
+		return new SimpleAtomicItemTypeImpl(BuiltinTypeLibrary.XS_ANYTYPE, ItemType.OCCURRENCE_NONE_OR_MANY);
+	}
+
 	/**
 	 * Clears the sequence.
 	 */
-	@Override
 	public void clear() {
 		_seq.clear();
 	}
@@ -122,8 +133,8 @@
 	 * 
 	 * @return The new sequence.
 	 */
-	@Override
 	public ResultSequence create_new() {
 		return new DefaultResultSequence();
 	}
+	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultStaticContext.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultStaticContext.java
index bd7df63..97411fd 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultStaticContext.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DefaultStaticContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@
 
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 
@@ -35,7 +34,6 @@
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
-import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
 /**
@@ -70,11 +68,11 @@
 		_cntxt_item_type = cntxtItemType;
 	}
 
-	public Map<String, List<Document>> get_collections() {
+	public Map get_collections() {
 		return _collections;
 	}
 
-	public void set_collections(Map<String, List<Document>> collections) {
+	public void set_collections(Map collections) {
 		_collections = collections;
 	}
 
@@ -227,7 +225,7 @@
 		return fl.function_exists(name, arity);
 	}
 
-	protected Function function(QName name, int arity) {
+	public Function function(QName name, int arity) {
 		String ns = name.namespace();
 		if (!_functions.containsKey(ns))
 			return null;
@@ -617,7 +615,7 @@
 				String string_val = "null";
 
 				if (val != null)
-					string_val = val.string_value();
+					string_val = val.getStringValue();
 
 				System.out.println("Varname: " + varname.string()
 						+ " expanded=" + varname.expanded() + " Value: "
@@ -647,4 +645,8 @@
 	public TypeModel getTypeModel(Node node) {
 		return _model;
 	}
+
+	public Map get_function_libraries() {
+		return _functions;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantAxis.java
index 0cea2ee..9c9ae4a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantAxis.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,15 +7,14 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * The descendant axis contains the descendants of the context node
@@ -27,32 +26,12 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The descendants of the context node.
 	 */
-	@Override
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		// get the children
-		ResultSequence rs = super.iterate(node, dc);
-
-		ArrayList descendants = new ArrayList();
-
-		// get descendants of all children
-		for (Iterator i = rs.iterator(); i.hasNext();) {
-			NodeType n = (NodeType) i.next();
-
-			descendants.add(iterate(n, dc));
-		}
-
-		// add descendants to result
-		for (Iterator i = descendants.iterator(); i.hasNext();) {
-			ResultSequence desc = (ResultSequence) i.next();
-
-			rs.concat(desc);
-		}
-
-		return rs;
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
+		addChildren(node, copyInto, true);
 	}
 
+	public String name() {
+		return "descendant";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantOrSelfAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantOrSelfAxis.java
index ebc0243..049026d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantOrSelfAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DescendantOrSelfAxis.java
@@ -11,10 +11,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * The descendant-or-self axis contains the context node and the descendants of
@@ -29,22 +28,17 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The context node and its descendants.
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+	public void iterate(NodeType node, ResultBuffer rs, Node limitNode) {
 
 		// add self
 		rs.add(node);
 
 		// add descendants
-		DescendantAxis da = new DescendantAxis();
-		ResultSequence desc = da.iterate(node, dc);
-		rs.concat(desc);
-
-		return rs;
+		new DescendantAxis().iterate(node, rs, null);
 	}
 
+	public String name() {
+		return "descendant-or-self";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DynamicContextAdapter.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DynamicContextAdapter.java
new file mode 100644
index 0000000..3dec635
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/DynamicContextAdapter.java
@@ -0,0 +1,80 @@
+package org.eclipse.wst.xml.xpath2.processor.internal;
+
+import java.net.URI;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+
+import org.eclipse.wst.xml.xpath2.api.CollationProvider;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.FnCollection;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.DocType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+public class DynamicContextAdapter implements
+		org.eclipse.wst.xml.xpath2.api.DynamicContext {
+	private final org.eclipse.wst.xml.xpath2.processor.DynamicContext dc;
+	private StaticContextAdapter sca;
+
+	public DynamicContextAdapter(
+			org.eclipse.wst.xml.xpath2.processor.DynamicContext dc) {
+		this.dc = dc;
+		this.sca = new StaticContextAdapter(dc);
+	}
+
+	public Node getLimitNode() {
+		return null;
+	}
+
+	public ResultSequence getVariable(javax.xml.namespace.QName name) {
+		Object var = dc.get_variable(new QName(name));
+		if (var == null) return ResultBuffer.EMPTY;
+		if (var instanceof ResultSequence) return (ResultSequence)var;
+		return ResultBuffer.wrap((Item)var);
+	}
+
+	public URI resolveUri(String uri) {
+		return dc.resolve_uri(uri);
+	}
+
+	public GregorianCalendar getCurrentDateTime() {
+		return dc.current_date_time();
+	}
+
+	public Duration getTimezoneOffset() {
+		XSDuration tz = dc.tz();
+		try {
+			return DatatypeFactory.newInstance().newDuration(! tz.negative(), 0, 0, 0, tz.hours(), tz.minutes(), 0);
+		} catch (DatatypeConfigurationException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	public Document getDocument(URI uri) {
+		org.eclipse.wst.xml.xpath2.processor.ResultSequence rs = dc.get_doc(uri);
+		if (rs == null || rs.empty()) return null;
+		return ((DocType)(rs.get(0))).value();
+	}
+
+	public Map<String, List<Document>> getCollections() {
+		return dc.get_collections();
+	}
+
+	public List<Document> getDefaultCollection() {
+		return getCollections().get(FnCollection.DEFAULT_COLLECTION_URI);
+	}
+
+	public CollationProvider getCollationProvider() {
+		return sca.getCollationProvider();
+	}
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Focus.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Focus.java
index 6c8069e..dbf0523 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Focus.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Focus.java
@@ -12,15 +12,15 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 
 /**
  * set the focus from a result sequence
  */
 public class Focus {
 	private int _cp; // context position
-	private ResultSequence _rs; // all items in context
+	private org.eclipse.wst.xml.xpath2.api.ResultSequence _rs; // all items in context
 
 	/**
 	 * Sets the _rs to rs and context position to 1.
@@ -41,7 +41,7 @@
 	public AnyType context_item() {
 		// idexes start at 0
 		if (_cp > _rs.size()) return null;
-		return _rs.get(_cp - 1);
+		return (AnyType)_rs.item(_cp - 1);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingAxis.java
index 75b4b37..5f3ab53 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingAxis.java
@@ -11,12 +11,11 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * the following axis contains the context node's following siblings, those
@@ -30,43 +29,44 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The result of FollowingAxis.
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		ResultSequence result = ResultSequenceFactory.create_new();
+	public void iterate(NodeType node, ResultBuffer result, Node limitNode) {
 
 		// XXX should be root... not parent!!! read the spec.... BUG BUG
 		// BUG LAME LAME....
 
+		if (limitNode != null && limitNode.isSameNode(node.node_value())) {
+			// no further, we have reached the limit node
+			return;
+		}
+		
 		// get the parent
 		NodeType parent = null;
-		ParentAxis pa = new ParentAxis();
-		ResultSequence rs = pa.iterate(node, dc);
-		if (rs.size() == 1)
-			parent = (NodeType) rs.get(0);
+		ResultBuffer parentBuffer = new ResultBuffer();
+		new ParentAxis().iterate(node, parentBuffer, limitNode);
+		if (parentBuffer.size() == 1)
+			parent = (NodeType) parentBuffer.item(0);
 
 		// get the following siblings of this node, and add them
 		FollowingSiblingAxis fsa = new FollowingSiblingAxis();
-		rs = fsa.iterate(node, dc);
-		result.concat(rs);
+		ResultBuffer siblingBuffer = new ResultBuffer();
+		fsa.iterate(node, siblingBuffer, limitNode);
 
 		// for each sibling, get all its descendants
 		DescendantAxis da = new DescendantAxis();
-		for (Iterator i = rs.iterator(); i.hasNext();) {
-			ResultSequence desc = da.iterate((NodeType) i.next(), dc);
-
-			// add all descendants to the result
-			result.concat(desc);
+		for (Iterator i = siblingBuffer.iterator(); i.hasNext();) {
+			result.add((NodeType)i);
+			da.iterate((NodeType) i.next(), result, null);
 		}
 
 		// if we got a parent, we gotta repeat the story for the parent
 		// and add the results
 		if (parent != null) {
-			rs = iterate(parent, dc);
-			result.concat(rs);
+			iterate(parent, result, limitNode);
 		}
-		return result;
+	}
+	
+	public String name() {
+		return "following";
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingSiblingAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingSiblingAxis.java
index f4cc78d..28b36e2 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingSiblingAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/FollowingSiblingAxis.java
@@ -11,11 +11,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * The following-sibling axis contains the context node's following siblings,
@@ -30,44 +28,22 @@
 	 * 
 	 * @param node
 	 *            is the type of node.
-	 * @param dc
-	 *            is the dynamic context.
-	 * @return The result of FollowingSiblingAxis.
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
 		// XXX check for attribute / namespace node... if so return
 		// empty sequence
 
-		// get the parent
-		ParentAxis pa = new ParentAxis();
-		ResultSequence rs = pa.iterate(node, dc);
-
-		// XXX: if no parent, out of luck i guess
-		if (rs.size() == 0)
-			return rs;
-
+		Node iterNode = node.node_value();
 		// get the children of the parent [siblings]
-		ChildAxis ca = new ChildAxis();
-		NodeType parent = (NodeType) rs.get(0);
-		rs = ca.iterate(parent, dc);
-
-		// get the following siblings
-		for (Iterator i = rs.iterator(); i.hasNext();) {
-			NodeType n = (NodeType) i.next();
-
-			// if we haven't found the node yet, remove elements
-			// [preciding siblings]
-			// note: if node is first... its ok... cuz we don't
-			// include node...
-			i.remove();
-
-			// check reference of DOM object... should be correct ?!
-			// dunno... XXX
-			if (n.node_value() == node.node_value())
-				break;
-		}
-
-		return rs;
+		do {
+			iterNode = iterNode.getNextSibling();
+			if (iterNode != null) {
+				copyInto.add(NodeType.dom_to_xpath(iterNode, node.getTypeModel()));
+			}
+		} while (iterNode != null);
 	}
-
+	
+	public String name() {
+		return "following-sibling";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ForwardAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ForwardAxis.java
index d95bce8..fe86811 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ForwardAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ForwardAxis.java
@@ -11,7 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
 
 /**
  * An axis that only ever contains the context node or nodes that are after the
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Normalizer.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Normalizer.java
index f6c0547..c31e1f9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Normalizer.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/Normalizer.java
@@ -11,15 +11,75 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
 import org.eclipse.wst.xml.xpath2.processor.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.ast.XPath;
 import org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary;
-import org.eclipse.wst.xml.xpath2.processor.internal.ast.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
-import java.math.BigInteger;
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AddExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AndExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CastableExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CmpExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CntxItemExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DecimalLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DivExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.DoubleLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ExceptExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.Expr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ForExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ForwardStep;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IDivExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IfExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.InstOfExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IntegerLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.IntersectExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.MinusExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ModExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.MulExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.NameTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.NodeTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.OrExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ParExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.PipeExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.PlusExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.PrimaryExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.QuantifiedExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.RangeExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ReverseStep;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.Step;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.StepExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.StringLiteral;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SubExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.TreatAsExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.UnExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.UnionExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.VarExprPair;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.VarRef;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathExpr;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.OpFunctionLibrary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Normalizer that uses XPathVisitor.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ParentAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ParentAxis.java
index d54dd87..aa682f7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ParentAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ParentAxis.java
@@ -12,11 +12,10 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.w3c.dom.*;
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
 
 /**
  * the parent axis contains the sequence returned by the dm:parent accessor in,
@@ -32,12 +31,23 @@
 	 *            is the node type.
 	 * @throws dc
 	 *             is the Dynamic context.
-	 * @return the accessors.
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
 		Node n = node.node_value();
+		
+		if (limitNode != null && limitNode.isSameNode(n)) {
+			// no further, we have reached the limit node
+			return;
+		}
+
+		Node parent = findParent(n);
+
+		// if a parent exists... add it
+		if (parent != null)
+			copyInto.add(NodeType.dom_to_xpath(parent, node.getTypeModel()));
+	}
+
+	public Node findParent(Node n) {
 		Node parent = n.getParentNode();
 
 		// special case attribute elements...
@@ -47,12 +57,10 @@
 
 			parent = att.getOwnerElement();
 		}
-
-		// if a parent exists... add it
-		if (parent != null)
-			rs.add(NodeType.dom_to_xpath(parent, dc.getTypeModel(n)));
-
-		return rs;
+		return parent;
 	}
-
+	
+	public String name() {
+		return "parent";
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingAxis.java
index d491863..342e9ee 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingAxis.java
@@ -11,12 +11,11 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * the preceding axis contains all nodes that are descendants of the root of the
@@ -32,40 +31,39 @@
 	 *            is the node type.
 	 * @throws dc
 	 *             is the Dynamic context.
-	 * @return the descendants of the context node
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		ResultSequence result = ResultSequenceFactory.create_new();
+	public void iterate(NodeType node, ResultBuffer result, Node limitNode) {
+
+		if (limitNode != null && limitNode.isSameNode(node.node_value())) {
+			// no further, we have reached the limit node
+			return;
+		}
 
 		// get the parent
 		NodeType parent = null;
-		ParentAxis pa = new ParentAxis();
-		ResultSequence rs = pa.iterate(node, dc);
-		if (rs.size() == 1)
-			parent = (NodeType) rs.get(0);
+		ResultBuffer parentBuffer = new ResultBuffer();
+		new ParentAxis().iterate(node, parentBuffer, limitNode);
+		if (parentBuffer.size() == 1) {
+			parent = (NodeType) parentBuffer.item(0);
+			// if we got a parent, we gotta repeat the story for the parent
+			// and add the results
+			iterate(parent, result, limitNode);
+		}
 
-		// get the preceding siblings of this node, and add them
+		// get the following siblings of this node, and add them
 		PrecedingSiblingAxis psa = new PrecedingSiblingAxis();
-		rs = psa.iterate(node, dc);
-		result.concat(rs);
+		ResultBuffer siblingBuffer = new ResultBuffer();
+		psa.iterate(node, siblingBuffer, limitNode);
 
 		// for each sibling, get all its descendants
 		DescendantAxis da = new DescendantAxis();
-		for (Iterator i = rs.iterator(); i.hasNext();) {
-			ResultSequence desc = da.iterate((NodeType) i.next(), dc);
-
-			// add all descendants to the result
-			result.concat(desc);
+		for (Iterator i = siblingBuffer.iterator(); i.hasNext();) {
+			result.add((NodeType)i);
+			da.iterate((NodeType) i.next(), result, null);
 		}
-
-		// if we got a parent, we gotta repeat the story for the parent
-		// and add the results
-		if (parent != null) {
-			rs = iterate(parent, dc);
-
-			rs.concat(result);
-			result = rs;
-		}
-		return result;
+	}
+	
+	public String name() {
+		return "preceding";
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingSiblingAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingSiblingAxis.java
index 8290814..edf4666 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingSiblingAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/PrecedingSiblingAxis.java
@@ -11,11 +11,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * the preceding axis contains all nodes that are descendants of the root of the
@@ -31,44 +29,24 @@
 	 *            is the node type.
 	 * @throws dc
 	 *             is the Dynamic context.
-	 * @return the descendants and the context node
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		boolean found = false;
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
 		// XXX check for attribute / namespace node... if so return
 		// empty sequence
 
-		// get the parent
-		ParentAxis pa = new ParentAxis();
-		ResultSequence rs = pa.iterate(node, dc);
-
-		// XXX: if no parent, out of luck i guess
-		if (rs.size() == 0)
-			return rs;
-
+		int pos = copyInto.size();
+		Node iterNode = node.node_value();
 		// get the children of the parent [siblings]
-		ChildAxis ca = new ChildAxis();
-		NodeType parent = (NodeType) rs.get(0);
-		rs = ca.iterate(parent, dc);
-
-		// get the preceding siblings
-		for (Iterator i = rs.iterator(); i.hasNext();) {
-			NodeType n = (NodeType) i.next();
-
-			// ok we passed the node, so just erase the rest of the
-			// results
-			if (found) {
-				i.remove();
-				continue;
+		do {
+			iterNode = iterNode.getPreviousSibling();
+			if (iterNode != null) {
+				copyInto.addAt(pos, NodeType.dom_to_xpath(iterNode, node.getTypeModel()));
 			}
+		} while (iterNode != null);
+	}
 
-			if (n.node_value() == node.node_value()) {
-				i.remove();
-				found = true;
-			}
-		}
-
-		return rs;
+	public String name() {
+		return "preceding-sibling";
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/RangeResultSequence.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/RangeResultSequence.java
index 994acb2..8cd21e1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/RangeResultSequence.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/RangeResultSequence.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,8 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
@@ -15,9 +17,11 @@
 import java.math.BigInteger;
 import java.util.*;
 
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A range expression can be used to construct a sequence of consecutive
@@ -55,7 +59,6 @@
 	 * @param item
 	 *            is an integer.
 	 */
-	@Override
 	public void add(AnyType item) {
 		_tail.add(item);
 	}
@@ -66,7 +69,6 @@
 	 * @param rs
 	 *            is the range
 	 */
-	@Override
 	public void concat(ResultSequence rs) {
 		_tail.concat(rs);
 	}
@@ -76,7 +78,6 @@
 	 * 
 	 * @return tail
 	 */
-	@Override
 	public ListIterator iterator() {
 		// XXX life is getting hard...
 		if (_size != 0) {
@@ -101,7 +102,6 @@
 	/**
 	 * @return item from range
 	 */
-	@Override
 	public AnyType get(int i) {
 		if (i < _size)
 			return new XSInteger(BigInteger.valueOf(_start + i));
@@ -112,7 +112,6 @@
 	/**
 	 * @return size
 	 */
-	@Override
 	public int size() {
 		return _size + _tail.size();
 	}
@@ -120,7 +119,6 @@
 	/**
 	 * clear range
 	 */
-	@Override
 	public void clear() {
 		_size = 0;
 		_tail.clear();
@@ -131,7 +129,6 @@
 	 * 
 	 * @return null
 	 */
-	@Override
 	public ResultSequence create_new() {
 		assert false;
 		return null;
@@ -140,25 +137,33 @@
 	/**
 	 * @return first item in range
 	 */
-	@Override
 	public AnyType first() {
 		return get(0);
 	}
 
 	/**
+	 * @return first item in range
+	 */
+	public Object firstValue() {
+		return get(0).getNativeValue();
+	}
+
+	/**
 	 * asks if the range is empty?
 	 * 
 	 * @return boolean
 	 */
-	@Override
 	public boolean empty() {
 		return size() == 0;
 	}
 
+	public ItemType sequenceType() {
+		return new SimpleAtomicItemTypeImpl(BuiltinTypeLibrary.XS_INTEGER, ItemType.OCCURRENCE_NONE_OR_MANY);
+	}
+
 	/**
 	 * release
 	 */
-	@Override
 	public void release() {
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ReverseAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ReverseAxis.java
index 36070d4..941476e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ReverseAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ReverseAxis.java
@@ -11,7 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
 
 /**
  * An axis that only ever contains the context node or nodes that are before the
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SelfAxis.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SelfAxis.java
index c8eed2e..29690e5 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SelfAxis.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SelfAxis.java
@@ -11,10 +11,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.w3c.dom.Node;
 
 /**
  * Create a result sequence that contains the context node
@@ -26,16 +25,13 @@
 	 * 
 	 * @param node
 	 *            is the node type
-	 * @param dc
-	 *            is the dynamic context
-	 * @return rs containing node
 	 */
-	public ResultSequence iterate(NodeType node, DynamicContext dc) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(node);
-
-		return rs;
+	public void iterate(NodeType node, ResultBuffer copyInto, Node limitNode) {
+		copyInto.add(node);
+	}
+	
+	public String name() {
+		return "self";
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SeqType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SeqType.java
index 9b54e0d..60a22d3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SeqType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/SeqType.java
@@ -14,14 +14,22 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.ast.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-import org.w3c.dom.Node;
+import java.util.Iterator;
+import java.util.Map;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest;
+import org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.ConstructorFL;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.w3c.dom.Node;
 
 /**
  * represents a Sequence types used for matching expected arguments of functions
@@ -108,7 +116,7 @@
 
 			// XXX IMPLEMENT THIS
 		case ItemType.QNAME:
-			final AnyAtomicType aat = sc.make_atomic(item.qname());
+			final AnyAtomicType aat = make_atomic(sc, item.qname());
 
 			assert aat != null;
 			anytype = aat;
@@ -135,6 +143,23 @@
 		wild = ktest.isWild();
 	}
 
+	private AnyAtomicType make_atomic(StaticContext sc, QName qname) {
+		String ns = qname.namespace();
+
+		Map functionLibraries = sc.getFunctionLibraries();
+		if (!functionLibraries.containsKey(ns))
+			return null;
+
+		FunctionLibrary fl = (FunctionLibrary) functionLibraries.get(ns);
+
+		if (!(fl instanceof ConstructorFL))
+			return null;
+
+		ConstructorFL cfl = (ConstructorFL) fl;
+
+		return cfl.atomic_type(qname);
+	}
+
 	public static int mapSequenceTypeOccurrence(int occurrence) {
 		// convert occurrence
 		switch (occurrence) {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/StaticContextAdapter.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/StaticContextAdapter.java
new file mode 100644
index 0000000..9829399
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/StaticContextAdapter.java
@@ -0,0 +1,195 @@
+package org.eclipse.wst.xml.xpath2.processor.internal;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+
+import org.eclipse.wst.xml.xpath2.api.CollationProvider;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Function;
+import org.eclipse.wst.xml.xpath2.api.FunctionLibrary;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.StaticVariableResolver;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
+import org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeItemTypeImpl;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+import org.w3c.dom.Node;
+
+public class StaticContextAdapter implements
+		org.eclipse.wst.xml.xpath2.api.StaticContext {
+	private final org.eclipse.wst.xml.xpath2.processor.StaticContext sc;
+
+	public StaticContextAdapter(
+			org.eclipse.wst.xml.xpath2.processor.StaticContext sc) {
+		this.sc = sc;
+	}
+
+	public boolean isXPath1Compatible() {
+		return sc.xpath1_compatible();
+	}
+
+	public StaticVariableResolver getInScopeVariables() {
+		return new StaticVariableResolver() {
+			
+			public boolean isVariablePresent(javax.xml.namespace.QName name) {
+				return sc.variable_exists(qn(name));
+			}
+
+			public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType getVariableType(javax.xml.namespace.QName name) {
+				return new SimpleAtomicItemTypeImpl(BuiltinTypeLibrary.XS_ANYTYPE);
+			}
+		};
+	}
+
+	private QName qn(javax.xml.namespace.QName name) {
+		return new QName(name);
+	}
+
+	public TypeDefinition getInitialContextType() {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+	}
+
+	public Map<String, FunctionLibrary> getFunctionLibraries() {
+		if (sc instanceof DefaultStaticContext) {
+			DefaultStaticContext dsc = (DefaultStaticContext)sc;
+			return dsc.get_function_libraries();
+		}
+		return Collections.emptyMap();
+	}
+
+	public CollationProvider getCollationProvider() {
+		if (sc instanceof DynamicContext) {
+			final DynamicContext dc = (DynamicContext)sc;
+			return new CollationProvider() {
+				
+				public String getDefaultCollation() {
+					return dc.default_collation_name();
+				}
+				
+				public Comparator getCollation(String name) {
+					return dc.get_collation(name);
+				}
+			};
+		}
+		
+		return new CollationProvider() {
+			
+			public String getDefaultCollation() {
+				return null;
+			}
+			
+			public Comparator getCollation(String name) {
+				return null;
+			}
+		};
+	}
+
+	public URI getBaseUri() {
+		// TODO Auto-generated method stub
+		try {
+			return new URI(sc.base_uri().getStringValue());
+		} catch (URISyntaxException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	public NamespaceContext getNamespaceContext() {
+		return new NamespaceContext() {
+			
+			public Iterator getPrefixes(String arg0) {
+				return Collections.emptyList().iterator();
+			}
+			
+			public String getPrefix(String arg0) {
+				return "x";
+			}
+			
+			public String getNamespaceURI(String prefix) {
+				String ns = sc.resolve_prefix(prefix);
+				return ns != null ? ns : XMLConstants.NULL_NS_URI;
+			}
+		};
+	}
+
+	public String getDefaultNamespace() {
+		return sc.default_namespace();
+	}
+
+	public String getDefaultFunctionNamespace() {
+		return sc.default_function_namespace();
+	}
+
+	public TypeModel getTypeModel() {
+		return sc.getTypeModel(null);
+	}
+
+	public Function resolveFunction(javax.xml.namespace.QName name, int arity) {
+		if (sc.function_exists(new QName(name), arity)) {
+			if (sc instanceof DefaultDynamicContext) {
+				DefaultDynamicContext dc = (DefaultDynamicContext)sc;
+				return dc.function(new QName(name), arity);
+			}
+			return new Function() {
+				public String getName() {
+					return null;
+				}
+				public int getMinArity() {
+					return 0;
+				}
+				public int getMaxArity() {
+					return 0;
+				}
+				public boolean isVariableArgument() {
+					return false;
+				}
+				public boolean canMatchArity(int actualArity) {
+					return false;
+				}
+				public TypeDefinition getResultType() {
+					return null;
+				}
+				public TypeDefinition getArgumentType(int index) {
+					return null;
+				}
+				public String getArgumentNameHint(int index) {
+					return null;
+				}
+				public ResultSequence evaluate(Collection args, EvaluationContext evaluationContext) {
+					return null;
+				}
+				public TypeDefinition computeReturnType(Collection args, StaticContext sc) {
+					return null;
+				} 
+			};
+		} else {
+			return null;
+		}
+	}
+
+	public TypeDefinition getCollectionType(String collectionName) {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+	}
+
+	public TypeDefinition getDefaultCollectionType() {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+
+	}
+
+	public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType getDocumentType(
+			URI documentUri) {
+		return new NodeItemTypeImpl(org.eclipse.wst.xml.xpath2.api.typesystem.ItemType.OCCURRENCE_OPTIONAL, Node.DOCUMENT_NODE);
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AddExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AddExpr.java
index 5950840..d93325d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AddExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AddExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AndExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AndExpr.java
index 28b837c..6e33163 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AndExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AndExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AnyKindTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AnyKindTest.java
index 7822491..f28f9b0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AnyKindTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AnyKindTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,13 +7,13 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
- *     David Carver - bug 298535 - Attribute instance of improvements 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4 
  ******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
@@ -28,27 +28,22 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		return null;
 	}
 
-	@Override
 	public QName name() {
 		return null;
 	}
 
-	@Override
 	public boolean isWild() {
 		return false;
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		return NodeType.class;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AttributeTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AttributeTest.java
index 88d861f..cedd0a0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AttributeTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AttributeTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,18 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     David Carver - bug 298535 - Attribute instance of improvements 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.api.Item;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
 import org.w3c.dom.Attr;
@@ -70,18 +72,16 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		if (name() == null && !wild()) {
 			return new AttrType();
 		}
 
-		AnyType at = rs.first();
+		Item at = rs.first();
 
 		if (!(at instanceof NodeType)) {
 			return new AttrType();
@@ -90,7 +90,7 @@
 		return createAttrType(at, sc);
 	}
 
-	private AnyType createAttrType(AnyType at, StaticContext sc) {
+	private AnyType createAttrType(Item at, StaticContext sc) {
 		anyType = new AttrType();
 		NodeType nodeType = (NodeType) at;
 		Node node = nodeType.node_value();
@@ -108,7 +108,7 @@
 			if (type() != null) {
 				anyType = createAttrForXSDType(node, sc);
 			} else {
-				anyType = new AttrType((Attr) node, sc.getTypeModel(node));
+				anyType = new AttrType((Attr) node, sc.getTypeModel());
 			}
 		}
 		return anyType;
@@ -117,26 +117,24 @@
 	private AnyType createAttrForXSDType(Node node, StaticContext sc) {
 		Attr attr = (Attr) node;
 		
-		TypeModel typeModel = sc.getTypeModel(attr);
+		TypeModel typeModel = sc.getTypeModel();
 		TypeDefinition typedef = typeModel.getType(attr);
 
 		if (typedef != null) {
 			if (typedef.derivedFrom(type().namespace(), type().local(),
 					getDerviationTypes())) {
-				anyType = new AttrType(attr, sc.getTypeModel(node));
+				anyType = new AttrType(attr, sc.getTypeModel());
 			}
 		} else {
-			anyType = new AttrType(attr, sc.getTypeModel(node));
+			anyType = new AttrType(attr, sc.getTypeModel());
 		}
 		return anyType;
 	}
 
-	@Override
 	public boolean isWild() {
 		return wild();
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		return AttrType.class;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AxisStep.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AxisStep.java
index 6dda7b2..e12e3c3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AxisStep.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/AxisStep.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -40,7 +41,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastExpr.java
index 8084930..27fc9d4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,10 +7,13 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
+import org.eclipse.wst.xml.xpath2.api.Function;
+
 /**
  * A class that creates a new value of a specific type based on an existing
  * value. A cast expression takes two operands: an input expression and a target
@@ -21,6 +24,7 @@
  * element/type namespace.
  */
 public class CastExpr extends BinExpr {
+	private Function _function;
 
 	/**
 	 * Constructor for CastExpr.
@@ -34,12 +38,20 @@
 		super(l, r);
 	}
 
+	
+	public Function function() {
+		return _function;
+	}
+	
+	public void set_function(Function _function) {
+		this._function = _function;
+	}
+	
 	/**
 	 * Support for Visitor interface.
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastableExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastableExpr.java
index 0b60281..c05f357 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastableExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CastableExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CmpExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CmpExpr.java
index 84785c0..d0e765e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CmpExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CmpExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -101,7 +102,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CntxItemExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CntxItemExpr.java
index 2deea82..0cd4694 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CntxItemExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CntxItemExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -20,7 +21,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CommentTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CommentTest.java
index 20ddee3..36644dd 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CommentTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/CommentTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,12 +8,13 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     David Carver - bug 298535 - Attribute instance of improvements 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.CommentType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
@@ -27,27 +28,22 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		return null;
 	}
 
-	@Override
 	public QName name() {
 		return null;
 	}
 
-	@Override
 	public boolean isWild() {
 		return false;
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		return CommentType.class;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DecimalLiteral.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DecimalLiteral.java
index 7b7ba7f..9157e7d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DecimalLiteral.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DecimalLiteral.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -38,7 +39,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DivExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DivExpr.java
index b8df3fd..00b66e4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DivExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DivExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DocumentTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DocumentTest.java
index 67830e5..ae1c24d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DocumentTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DocumentTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,12 +8,13 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 298535 - Attribute instance of improvements 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.DocType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
@@ -76,7 +77,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
@@ -108,24 +108,20 @@
 		return _schema_etest;
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	@Override
 	public QName name() {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	@Override
 	public boolean isWild() {
 		return false;
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		return DocType.class;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DoubleLiteral.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DoubleLiteral.java
index 0570e76..b0d8c3c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DoubleLiteral.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/DoubleLiteral.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -36,7 +37,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ElementTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ElementTest.java
index eda0e7d..c95207b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ElementTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ElementTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,14 +8,16 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     David Carver - bug 298535 - Attribute instance of improvements 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
@@ -91,7 +93,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
@@ -105,14 +106,13 @@
 		return _qmark;
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 
 		if (name() == null && !wild()) {
 			return new ElementType();
 		}
 
-		AnyType at = rs.first();
+		Item at = rs.first();
 
 		if (!(at instanceof NodeType)) {
 			return new ElementType();
@@ -121,7 +121,7 @@
 		return createElementType(at, sc);
 	}
 
-	private AnyType createElementType(AnyType at, StaticContext sc) {
+	private AnyType createElementType(Item at, StaticContext sc) {
 		anyType = new ElementType();
 		NodeType nodeType = (NodeType) at;
 		Node node = nodeType.node_value();
@@ -150,7 +150,7 @@
 		for (int i = 0; i < nodeList.getLength(); i++) {
 			Element element = (Element) nodeList.item(i);
 			
-			TypeModel typeModel = sc.getTypeModel(element);
+			TypeModel typeModel = sc.getTypeModel();
 			TypeDefinition typedef = typeModel.getType(element);
 			if (type() == null || typedef == null) {
 				anyType = new ElementType(element, typeModel);
@@ -166,12 +166,10 @@
 		return anyType;
 	}
 
-	@Override
 	public boolean isWild() {
 		return wild();
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		return ElementType.class;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ExceptExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ExceptExpr.java
index 7826ada..09319cc 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ExceptExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ExceptExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -35,7 +36,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FilterExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FilterExpr.java
index 9a30cc0..a6415c9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FilterExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FilterExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -46,7 +47,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForExpr.java
index 78865e6..cac121e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -38,7 +39,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForwardStep.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForwardStep.java
index f0a13bc..559280f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForwardStep.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ForwardStep.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,11 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
+import org.eclipse.wst.xml.xpath2.processor.StaticError;
+import org.eclipse.wst.xml.xpath2.processor.internal.AttributeAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.FollowingAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis;
+import org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis;
 
 /**
  * Class for Forward stepping support for Step operations.
@@ -102,6 +111,9 @@
 			_iterator = new DescendantOrSelfAxis();
 			break;
 
+		case NAMESPACE:
+			throw new StaticError("XPST0010", "namespace axis not implemented");
+			
 		default:
 			assert false;
 			break;
@@ -129,7 +141,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FunctionCall.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FunctionCall.java
index 39b5725..dca5548 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FunctionCall.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/FunctionCall.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,12 +7,14 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
 import java.util.*;
 
+import org.eclipse.wst.xml.xpath2.api.Function;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
 
 /**
@@ -21,6 +23,7 @@
 public class FunctionCall extends PrimaryExpr {
 	private QName _name;
 	private Collection _args;
+	private Function _function;
 
 	/**
 	 * Constructor for FunctionCall.
@@ -34,13 +37,20 @@
 		_name = name;
 		_args = args;
 	}
+	
+	public Function function() {
+		return _function;
+	}
+	
+	public void set_function(Function _function) {
+		this._function = _function;
+	}
 
 	/**
 	 * Support for Visitor interface.
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IDivExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IDivExpr.java
index 830fdaa..92c0c11 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IDivExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IDivExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IfExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IfExpr.java
index e2f6c79..4ba1960 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IfExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IfExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -42,7 +43,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/InstOfExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/InstOfExpr.java
index 857caa6..84e7127 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/InstOfExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/InstOfExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntegerLiteral.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntegerLiteral.java
index 04cc1c9..0e296d7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntegerLiteral.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntegerLiteral.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -39,7 +40,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntersectExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntersectExpr.java
index 241ef6c..348772d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntersectExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/IntersectExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ItemType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ItemType.java
index 4c304e0..ba1cf7b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ItemType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ItemType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -64,7 +65,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/KindTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/KindTest.java
index 0cc3304..591e610 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/KindTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/KindTest.java
@@ -12,8 +12,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MinusExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MinusExpr.java
index 42c56f2..2b1e1cc 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MinusExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MinusExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -30,7 +31,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ModExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ModExpr.java
index 607fdd6..cbcc6b8 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ModExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ModExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MulExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MulExpr.java
index 91204f2..230040a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MulExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/MulExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/NameTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/NameTest.java
index e25ac48..55a75b4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/NameTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/NameTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/OrExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/OrExpr.java
index c3e9c24..cfd2837 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/OrExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/OrExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Resulf of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PITest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PITest.java
index e56f206..0327fd1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PITest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PITest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,12 +8,13 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     David Carver - bug 298535 - Attribute instance of improvements 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.PIType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
@@ -46,7 +47,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
@@ -60,24 +60,20 @@
 		return _arg;
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	@Override
 	public QName name() {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	@Override
 	public boolean isWild() {
 		return false;
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		return PIType.class;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ParExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ParExpr.java
index c880ac2..81da43c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ParExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ParExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PipeExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PipeExpr.java
index 6f6c1ce..e01bc0e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PipeExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PipeExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PlusExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PlusExpr.java
index 9e7eae4..75d57b9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PlusExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/PlusExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -30,7 +31,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/QuantifiedExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/QuantifiedExpr.java
index 6a8255f..3f0c341 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/QuantifiedExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/QuantifiedExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -52,7 +53,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/RangeExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/RangeExpr.java
index 1896bcd..edfeaeb 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/RangeExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/RangeExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ReverseStep.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ReverseStep.java
index d3c68e0..35a33e0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ReverseStep.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/ReverseStep.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -95,7 +96,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaAttrTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaAttrTest.java
index 8552399..056909b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaAttrTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaAttrTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,12 +7,13 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
 
 /**
@@ -36,7 +37,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
@@ -50,23 +50,19 @@
 		return _arg;
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	@Override
 	public QName name() {
 		return _arg;
 	}
 
-	@Override
 	public boolean isWild() {
 		return false;
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		// TODO Auto-generated method stub
 		return null;
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaElemTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaElemTest.java
index 6443cd1..2322612 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaElemTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SchemaElemTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,12 +7,13 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
 
 /**
@@ -36,7 +37,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
@@ -50,18 +50,15 @@
 		return _arg;
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	@Override
 	public boolean isWild() {
 		return false;
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		// TODO Auto-generated method stub
 		return null;
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SequenceType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SequenceType.java
index 4193587..e1d1ff7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SequenceType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SequenceType.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moller - bug 312191 - instance of test fails with partial matches
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -58,7 +59,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SingleType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SingleType.java
index d61d5c1..b9592c9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SingleType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SingleType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -46,7 +47,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/StringLiteral.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/StringLiteral.java
index 706373b..93e4206 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/StringLiteral.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/StringLiteral.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -41,7 +42,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SubExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SubExpr.java
index 4d5a549..116a511 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SubExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/SubExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -32,7 +33,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TextTest.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TextTest.java
index 1e2f7aa..c4ede50 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TextTest.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TextTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,12 +8,13 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     David Carver - bug 298535 - Attribute instance of improvements 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.TextType;
@@ -27,27 +28,22 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
 
-	@Override
 	public AnyType createTestType(ResultSequence rs, StaticContext sc) {
 		return null;
 	}
 
-	@Override
 	public QName name() {
 		return null;
 	}
 
-	@Override
 	public boolean isWild() {
 		return false;
 	}
 
-	@Override
 	public Class getXDMClassType() {
 		return TextType.class;
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TreatAsExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TreatAsExpr.java
index d5083bd..5d8c87e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TreatAsExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/TreatAsExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -33,7 +34,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/UnionExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/UnionExpr.java
index 01dc893..1eb094c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/UnionExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/UnionExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -34,7 +35,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/VarRef.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/VarRef.java
index 14d22da..47c68ce 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/VarRef.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/VarRef.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -35,7 +36,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/XPathExpr.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/XPathExpr.java
index c229d04..224bb97 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/XPathExpr.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/XPathExpr.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.ast;
@@ -38,7 +39,6 @@
 	 * 
 	 * @return Result of Visitor operation.
 	 */
-	@Override
 	public Object accept(XPathVisitor v) {
 		return v.visit(this);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractCollationEqualFunction.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractCollationEqualFunction.java
index 6d06bf8..10a691a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractCollationEqualFunction.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractCollationEqualFunction.java
@@ -14,9 +14,9 @@
 import java.math.BigInteger;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
@@ -43,7 +43,7 @@
 
 
 	protected static boolean hasValue(AnyType itema, AnyType itemb, DynamicContext context, String collationURI) throws DynamicError {
-		XSString itemStr = new XSString(itema.string_value());
+		XSString itemStr = new XSString(itema.getStringValue());
 		if (isBoolean(itema, itemb)) {
 			XSBoolean boolat = (XSBoolean) itema;
 			if (boolat.eq(itemb, context)) {
@@ -66,7 +66,7 @@
 		}
 
 		if (needsStringComparison(itema, itemb)) {
-			XSString xstr1 = new XSString(itema.string_value());
+			XSString xstr1 = new XSString(itema.getStringValue());
 			if (FnCompare.compare_string(collationURI, xstr1, itemStr,
 					context).equals(BigInteger.ZERO)) {
 				return true;
@@ -75,9 +75,9 @@
 		return false;
 	}
 	
-	protected static boolean hasValue(ResultSequence rs, AnyAtomicType item,
+	protected static boolean hasValue(ResultBuffer rs, AnyAtomicType item,
 			DynamicContext context, String collationURI) throws DynamicError {
-		XSString itemStr = new XSString(item.string_value());
+		XSString itemStr = new XSString(item.getStringValue());
 
 		for (Iterator i = rs.iterator(); i.hasNext();) {
 			AnyType at = (AnyType) i.next();
@@ -107,7 +107,7 @@
 			}
 
 			if (needsStringComparison(item, at)) {
-				XSString xstr1 = new XSString(at.string_value());
+				XSString xstr1 = new XSString(at.getStringValue());
 				if (FnCompare.compare_string(collationURI, xstr1, itemStr,
 						context).equals(BigInteger.ZERO)) {
 					return true;
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractRegExFunction.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractRegExFunction.java
index 4fb3bb3..3312c9f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractRegExFunction.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractRegExFunction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     David Carver - bug 262765 - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
@@ -28,8 +29,8 @@
 	
 	protected static boolean matches(String pattern, String flags, String src) {
 		boolean fnd = false;
-		if (pattern.contains("-[")) {
-			pattern = pattern.replace("-[", "&&[^");
+		if (pattern.indexOf("-[") != -1) {
+			pattern = pattern.replaceAll("\\-\\[", "&&[^");
 		}
 		Matcher m = compileAndExecute(pattern, flags, src);
 		while (m.find()) {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractURIFunction.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractURIFunction.java
index ac6990e..350b529 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractURIFunction.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/AbstractURIFunction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail and others
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
  *     David Carver - STAR - bug 262765 - renamed to correct function name. 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 285319 - fix UTF-8 escaping
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -19,9 +20,8 @@
 import java.util.Collection;
 import java.util.Iterator;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
@@ -111,15 +111,12 @@
 		Iterator argi = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argi.next();
 	
-		ResultSequence rs = ResultSequenceFactory.create_new();
-	
 		if (arg1.empty()) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 				
-		AnyType aat = arg1.first();
-		String str = aat.string_value();
+		AnyType aat = (AnyType) arg1.item(0);
+		String str = aat.getStringValue();
 
 		ByteBuffer buffer = UTF_8.encode(str);
 		StringBuffer sb = new StringBuffer();
@@ -134,9 +131,7 @@
 				sb.append((char)x);
 		}
 	
-		rs.add(new XSString(sb.toString()));
-	
-		return rs;
+		return new XSString(sb.toString());
 	}
 
 	/**
@@ -161,10 +156,4 @@
 		super(name, min_arity, max_arity);
 	}
 
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpEq.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpEq.java
index 5ac02ea..f88f3fc 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpEq.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpEq.java
@@ -12,9 +12,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 
 /**
  * Class for compare for equal function.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpGt.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpGt.java
index 2bf0782..8cd0506 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpGt.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpGt.java
@@ -12,9 +12,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 
 /**
  * Class for compare for greater than operation.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpLt.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpLt.java
index b0c2c8e..61aaee6 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpLt.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/CmpLt.java
@@ -12,9 +12,9 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 
 /**
  * Class for compare for less than operation.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Constructor.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Constructor.java
index 8e2fff6..ac38fa2 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Constructor.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Constructor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,14 +9,16 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug274784 - improvements to xs:boolean data type implementation
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
 import java.util.Collection;
 
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
@@ -50,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		// sanity checks
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/ConstructorFL.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/ConstructorFL.java
index 1ba2497..70c573a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/ConstructorFL.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/ConstructorFL.java
@@ -11,9 +11,11 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Hashtable;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Constructor class for the functions library.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAbs.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAbs.java
index dd41148..78caf48 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAbs.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAbs.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,23 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
 
 /**
  * Returns the absolute value of $arg. If $arg is negative returns -$arg
@@ -46,8 +53,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 		// 1 argument only!
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
@@ -66,42 +72,35 @@
 	 * @return Result of fn:abs operation.
 	 */
 	public static ResultSequence fn_abs(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// sanity chex
 		NumericType nt = get_single_numeric_arg(arg);
 
 		// empty arg
 		if (nt == null)
-			return rs;
+			return ResultBuffer.EMPTY;
 		
 		if (nt instanceof XSDouble) {
 			XSDouble dat = (XSDouble) nt;
 			if (dat.zero() || dat.negativeZero()) {
-				rs.add(new XSDouble("0"));
-				return rs;
+				return new XSDouble("0");
 			}
 			if (dat.infinite()) {
-				rs.add(new XSDouble(Double.POSITIVE_INFINITY));
-				return rs;
+				return new XSDouble(Double.POSITIVE_INFINITY);
 			}
 		}
 
 		if (nt instanceof XSFloat) {
 			XSFloat dat = (XSFloat) nt;
 			if (dat.zero() || dat.negativeZero()) {
-				rs.add(new XSFloat(Float.valueOf(0)));
-				return rs;
+				return new XSFloat((new Float(0)).floatValue());
 			}
 			if (dat.infinite()) {
-				rs.add(new XSFloat(Float.POSITIVE_INFINITY));
-				return rs;
+				return new XSFloat(Float.POSITIVE_INFINITY);
 			}
 		}
 
 
-		rs.add(nt.abs());
-		return rs;
+		return nt.abs();
 	}
 
 	/**
@@ -122,7 +121,7 @@
 		if (size == 0)
 			return null;
 
-		AnyType at = arg.first();
+		AnyType at = (AnyType) arg.item(0);
 
 		if (!(at instanceof NumericType))
 			throw DynamicError.invalidType();
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateTimeToTimeZone.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateTimeToTimeZone.java
index 7e8c0cd..e7c4142 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateTimeToTimeZone.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateTimeToTimeZone.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail, and others
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,24 +7,29 @@
  *
  * Contributors:
  *     David Carver - bug 280547 - initial API and implementation. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
 
-import java.util.*;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
+
 /**
  * Adjusts an xs:dateTime value to a specific timezone, or to no timezone at
  * all. If <code>$timezone</code> is the empty sequence, returns an
@@ -54,9 +59,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return adjustdateTime(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
+		return adjustdateTime(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -71,62 +75,50 @@
 	 * @return Result of the fn:dateTime operation.
 	 */
 	public static ResultSequence adjustdateTime(Collection args,
-			DynamicContext dc) throws DynamicError {
+			org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext) throws DynamicError {
 
 		Collection cargs = Function.convert_arguments(args, expectedArgs());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 		ResultSequence arg2 = null;
 		if (argiter.hasNext()) {
 			arg2 = (ResultSequence) argiter.next();
 		}
-		XSDateTime dateTime = (XSDateTime) arg1.first();
+		XSDateTime dateTime = (XSDateTime) arg1.item(0);
 		XSDayTimeDuration timezone = null;
 		
 		if (arg2 != null && arg2.empty()) {
 			if (dateTime.timezoned()) {
 				CalendarType localized = new XSDateTime(dateTime.calendar(), null);
-				rs.add(localized);
-				return rs;
+				return localized;
 			} else {
 				return arg1;
 			}
 		} else if (arg2 == null) {
 			CalendarType localized = new XSDateTime(dateTime.normalizeCalendar(dateTime.calendar(), dateTime.tz()), null);
-			rs.add(localized);
-			return rs;
+			return localized;
 		}
 
-		timezone = (XSDayTimeDuration) arg2.first();
-		if (timezone.lt(minDuration, dc) || timezone.gt(maxDuration, dc)) {
+		timezone = (XSDayTimeDuration) arg2.item(0);
+		if (timezone.lt(minDuration, dynamicContext) || timezone.gt(maxDuration, dynamicContext)) {
 			throw DynamicError.invalidTimezone();
 		}
 		
 		if (dateTime.tz() == null) {
-			rs.add(new XSDateTime(dateTime.calendar(), timezone));
-			return rs;
+			return new XSDateTime(dateTime.calendar(), timezone);
 		}
 		
-		try {			
-			XMLGregorianCalendar xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar)dateTime.normalizeCalendar(dateTime.calendar(), dateTime.tz()));
-			
-			Duration duration = DatatypeFactory.newInstance().newDuration(timezone.string_value());
-			xmlCalendar.add(duration);
+		XMLGregorianCalendar xmlCalendar = _datatypeFactory.newXMLGregorianCalendar((GregorianCalendar)dateTime.normalizeCalendar(dateTime.calendar(), dateTime.tz()));
+		
+		Duration duration = _datatypeFactory.newDuration(timezone.getStringValue());
+		xmlCalendar.add(duration);
 
-			rs.add(new XSDateTime(xmlCalendar.toGregorianCalendar(), timezone));
-			
-		} catch (DatatypeConfigurationException e) {
-			throw DynamicError.invalidTimezone();
-		}
-		
-		return rs;
+		return new XSDateTime(xmlCalendar.toGregorianCalendar(), timezone);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateToTimeZone.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateToTimeZone.java
index 4fc4ef4..8d97b4e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateToTimeZone.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustDateToTimeZone.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail, and others
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,24 +7,29 @@
  *
  * Contributors:
  *     David Carver - bug 280547 - initial API and implementation. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
 
-import java.util.*;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
+
 /**
  * Adjusts an xs:date value to a specific timezone, or to no timezone at
  * all. If <code>$timezone</code> is the empty sequence, returns an
@@ -54,9 +59,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return adjustDate(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
+		return adjustDate(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -75,53 +79,43 @@
 
 		Collection cargs = Function.convert_arguments(args, expectedArgs());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
-		ResultSequence arg2 = ResultSequenceFactory.create_new();
+		ResultSequence arg2 = ResultBuffer.EMPTY;
 		if (argiter.hasNext()) {
 			arg2 = (ResultSequence) argiter.next();
 		}
-		XSDate date = (XSDate) arg1.first();
+		
+		XSDate date = (XSDate) arg1.item(0);
 		XSDayTimeDuration timezone = null;
 
 		if (arg2.empty()) {
 			if (date.timezoned()) {
 				XSDate localized = new XSDate(date.calendar(), null);
-				rs.add(localized);
-				return rs;
-			} else {
-				return arg1;
+				return localized;
 			}
+			return arg1;
 		}
 		
-		timezone = (XSDayTimeDuration) arg2.first();
+		timezone = (XSDayTimeDuration) arg2.item(0);
 		if (timezone.lt(minDuration, dc) || timezone.gt(maxDuration, dc)) {
 			throw DynamicError.invalidTimezone();
 		}
 		
 		if (date.tz() == null) {
-			rs.add(new XSDate(date.calendar(), timezone));
-			return rs;
+			return new XSDate(date.calendar(), timezone);
 		}
 		
-		try {
-			XMLGregorianCalendar xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar)date.normalizeCalendar(date.calendar(), date.tz()));
-			
-			Duration duration = DatatypeFactory.newInstance().newDuration(timezone.string_value());
-			xmlCalendar.add(duration);
-			
-			rs.add(new XSDate(xmlCalendar.toGregorianCalendar(), timezone));
-		} catch (DatatypeConfigurationException ex) {
-			throw DynamicError.invalidTimezone();
-		}
-
-		return rs;
+		XMLGregorianCalendar xmlCalendar = _datatypeFactory.newXMLGregorianCalendar((GregorianCalendar)date.normalizeCalendar(date.calendar(), date.tz()));
+		
+		Duration duration = _datatypeFactory.newDuration(timezone.getStringValue());
+		xmlCalendar.add(duration);
+		
+		return new XSDate(xmlCalendar.toGregorianCalendar(), timezone);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustTimeToTimeZone.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustTimeToTimeZone.java
index 2ddadcd..07897ee 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustTimeToTimeZone.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAdjustTimeToTimeZone.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail, and others
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,24 +7,29 @@
  *
  * Contributors:
  *     David Carver - bug 280547 - initial API and implementation. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
 
-import java.util.*;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
+
 /**
  * Adjusts an xs:dateTime value to a specific timezone, or to no timezone at
  * all. If <code>$timezone</code> is the empty sequence, returns an
@@ -32,6 +37,7 @@
  * <code>xs:dateTime</code> with a timezone.
  */
 public class FnAdjustTimeToTimeZone extends Function {
+
 	private static Collection _expected_args = null;
 	private static final XSDayTimeDuration minDuration = new XSDayTimeDuration(
 			0, 14, 0, 0, true);
@@ -54,9 +60,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return adjustTime(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
+		return adjustTime(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -75,15 +80,13 @@
 
 		Collection cargs = Function.convert_arguments(args, expectedArgs());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
-		ResultSequence arg2 = ResultSequenceFactory.create_new();
+		ResultSequence arg2 = ResultBuffer.EMPTY;
 		if (argiter.hasNext()) {
 			arg2 = (ResultSequence) argiter.next();
 		}
@@ -93,8 +96,7 @@
 		if (arg2.empty()) {
 			if (time.timezoned()) {
 				XSTime localized = new XSTime(time.calendar(), null);
-				rs.add(localized);
-				return rs;
+				return localized;
 			} else {
 				return arg1;
 			}
@@ -103,32 +105,25 @@
 
 		XMLGregorianCalendar xmlCalendar = null;
 		
-		try {
-			if (time.tz() != null) {
-				xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar)time.normalizeCalendar(time.calendar(), time.tz()));
-			} else {
-				xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendarTime(time.hour(), time.minute(), (int)time.second(), 0);
-			}
-	
-			timezone = (XSDayTimeDuration) arg2.first();
-			if (timezone.lt(minDuration, dc) || timezone.gt(maxDuration, dc)) {
-				throw DynamicError.invalidTimezone();
-			}
-			
-			if (time.tz() == null) {
-				rs.add(new XSTime(time.calendar(), timezone));
-				return rs;
-			}
-			
-			Duration duration = DatatypeFactory.newInstance().newDuration(timezone.string_value());
-			xmlCalendar.add(duration);
-	
-			rs.add(new XSTime(xmlCalendar.toGregorianCalendar(), timezone));
-		} catch (DatatypeConfigurationException ex) {
-			throw DynamicError.invalidTimezone();
+		if (time.tz() != null) {
+			xmlCalendar = _datatypeFactory.newXMLGregorianCalendar((GregorianCalendar)time.normalizeCalendar(time.calendar(), time.tz()));
+		} else {
+			xmlCalendar = _datatypeFactory.newXMLGregorianCalendarTime(time.hour(), time.minute(), (int)time.second(), 0);
 		}
 
-		return rs;
+		timezone = (XSDayTimeDuration) arg2.first();
+		if (timezone.lt(minDuration, dc) || timezone.gt(maxDuration, dc)) {
+			throw DynamicError.invalidTimezone();
+		}
+		
+		if (time.tz() == null) {
+			return new XSTime(time.calendar(), timezone);
+		}
+		
+		Duration duration = _datatypeFactory.newDuration(timezone.getStringValue());
+		xmlCalendar.add(duration);
+
+		return new XSTime(xmlCalendar.toGregorianCalendar(), timezone);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAvg.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAvg.java
index c91942d..fbdb2b5 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAvg.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnAvg.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
  *                                 and formatting occur correctly.
  *                               - fix fn:avg casting issues and divide by zero issues.
  *     Jesper Moller - bug 281028 - fix promotion rules for fn:avg
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -21,21 +22,16 @@
 import java.util.Collection;
 import java.util.Iterator;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.ScalarTypePromoter;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.TypePromoter;
 
@@ -60,8 +56,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return avg(args);
 	}
 
@@ -107,4 +102,10 @@
 
 		return ((MathDiv)total).div(ResultSequenceFactory.create_new(new XSInteger(BigInteger.valueOf(elems))));
 	}
+	
+	@Override
+	public TypeDefinition getResultType() {
+		// TODO Auto-generated method stub
+		return super.getResultType();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBaseUri.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBaseUri.java
index 8d90451..af28e90 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBaseUri.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBaseUri.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,19 +9,24 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Mukul Gandhi - bug274725 - implementation of base-uri function
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-import org.w3c.dom.Node;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
+import org.w3c.dom.Node;
 
 /**
  * Returns the value of the base-uri property for $arg as defined by the
@@ -55,9 +60,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return base_uri(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return base_uri(args, ec);
 	}
 
 	/**
@@ -71,7 +75,7 @@
 	 *             Dynamic error.
 	 * @return Result of fn:base-uri operation.
 	 */
-	public static ResultSequence base_uri(Collection args, DynamicContext d_context) 
+	public static ResultSequence base_uri(Collection args, EvaluationContext ec) 
 	                       throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 		
@@ -80,7 +84,7 @@
 		if (cargs.size() == 0) {
 		  // support for arity 0
 		  // get base-uri from the context item.
-		  AnyType contextItem = d_context.context_item();
+		  Item contextItem = ec.getContextItem();
 		  if (contextItem != null) {
 			rs = getBaseUri(contextItem);
 		  }
@@ -91,7 +95,7 @@
 		else if (cargs.size() == 1) {
 	      // support for arity 1
 		  ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
-		  AnyType att = arg1.first();
+		  Item att = arg1.empty() ? null : arg1.first();
 
 		  rs = getBaseUri(att);
 		}
@@ -106,8 +110,8 @@
 	/*
 	 * Helper function for base-uri support
 	 */
-	public static ResultSequence getBaseUri(AnyType att) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+	public static ResultSequence getBaseUri(Item att) {
+		ResultBuffer rs = new ResultBuffer();
 		XSAnyURI baseUri = null;
 		  // depending on the node type, we get the base-uri for the node.
 		  // if base-uri property in DOM is null, we set the base-uri as string "null". This
@@ -128,7 +132,7 @@
 	        rs.add(baseUri);	
 	      }
 	      
-	      return rs;
+	      return rs.getSequence();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBoolean.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBoolean.java
index 50b3e7a..e21f8ed 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBoolean.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnBoolean.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,16 +10,29 @@
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moller  - bug 262765 - use correct 'effective boolean value'
  *     David Carver (STAR) - bug 262765 - fix checking of data types.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic;
 
 /**
  * Computes the effective boolean value of the sequence $arg. If $arg is the
@@ -45,8 +58,7 @@
 	 *            argument expressions.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection/*<ResultSequence>*/ args, EvaluationContext ec) {
 		// 1 argument only!
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
@@ -55,10 +67,6 @@
 		return ResultSequenceFactory.create_new(fn_boolean(argument));
 	}
 
-	private static final XSBoolean TRUE = new XSBoolean(true);
-	
-	private static final XSBoolean FALSE = new XSBoolean(false);
-	
 	/**
 	 * Boolean operation.
 	 * 
@@ -69,50 +77,49 @@
 	 */
 	public static XSBoolean fn_boolean(ResultSequence arg) throws DynamicError {
 		if (arg.empty())
-			return FALSE;
+			return XSBoolean.FALSE;
 
-		AnyType at = arg.first();
+		Item at = arg.item(0);
 		
 		if (at instanceof CalendarType) {
 			throw DynamicError.throw_type_error();
 		}
-
 		
 		if (at instanceof NodeType)
-			return TRUE;
+			return XSBoolean.TRUE;
 		
 		if (arg.size() > 1)
 			throw DynamicError.throw_type_error();
 
 		// XXX ??
 		if (!(at instanceof AnyAtomicType))
-			return TRUE;
+			return XSBoolean.TRUE;
 
 		// ok we got 1 single atomic type element
 
 		if (at instanceof XSBoolean) {
 			if (!((XSBoolean) at).value())
-				return FALSE;
+				return XSBoolean.FALSE;
 		}
 
 		if ((at instanceof XSString) || (at instanceof XSUntypedAtomic)) {
-			if (at.string_value().equals(""))
-				return FALSE;
+			if (((AnyType)at).getStringValue().equals(""))
+				return XSBoolean.FALSE;
 		}
 
 		if (at instanceof NumericType) {
 			if (((NumericType) at).zero())
-				return FALSE;
+				return XSBoolean.FALSE;
 		}
 
 		if ((at instanceof XSFloat) && (((XSFloat) at).nan()))
-			return FALSE;
+			return XSBoolean.FALSE;
 
 		if ((at instanceof XSDouble) && (((XSDouble) at).nan()))
-			return FALSE;
+			return XSBoolean.FALSE;
 		
 
-		return TRUE;
+		return XSBoolean.TRUE;
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCeiling.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCeiling.java
index 869e85d..32bf929 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCeiling.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCeiling.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,18 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns the smallest (closest to negative infinity) number with no fractional
@@ -47,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		// 1 argument only!
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
@@ -68,16 +69,14 @@
 	 */
 	public static ResultSequence fn_ceiling(ResultSequence arg)
 			throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		// sanity chex
 		NumericType nt = FnAbs.get_single_numeric_arg(arg);
 
 		// empty arg
 		if (nt == null)
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		rs.add(nt.ceiling());
-		return rs;
+		return nt.ceiling();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointEqual.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointEqual.java
index 86fbc3e..2f2ca9d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointEqual.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointEqual.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moller, and others
+ * Copyright (c) 2009, 2010 Jesper Steen Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     Jesper Steen Moller - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -16,10 +17,12 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.CollationProvider;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
@@ -67,9 +70,8 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the comparison of the arguments.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return codepoint_equals(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return codepoint_equals(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -86,7 +88,7 @@
 	public static ResultSequence codepoint_equals(Collection args, DynamicContext dynamicContext) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -96,10 +98,10 @@
 		XSString xstr2 = arg2.empty() ? null : (XSString) arg2.first();
 
 		// This delegates to FnCompare
-		BigInteger result = FnCompare.compare_string(DynamicContext.CODEPOINT_COLLATION, xstr1, xstr2, dynamicContext);
+		BigInteger result = FnCompare.compare_string(CollationProvider.CODEPOINT_COLLATION, xstr1, xstr2, dynamicContext);
 		if (result != null) rs.add(new XSBoolean(BigInteger.ZERO.equals(result)));
 		
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointsToString.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointsToString.java
index f9c4951..c70792f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointsToString.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCodepointsToString.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,17 +11,23 @@
  *     David Carver - bug 282096 - improvements for surrogate handling 
  *     Jesper Steen Moeller - bug 282096 - clean up string storage
  *     Jesper Steen Moeller - bug 280553 - further checks of legal Unicode codepoints.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+
+import com.ibm.icu.text.UTF16;
 
 /**
  * Creates an xs:string from a sequence of code points. Returns the zero-length
@@ -58,8 +64,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return codepoints_to_string(args);
 	}
 
@@ -76,12 +81,9 @@
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 		if (arg1.empty()) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		int[] codePointArray = new int[arg1.size()];
@@ -98,17 +100,13 @@
 			codePointIndex++;
 		}
 
-		// "new String(int[] codePoints, int offset, int count)" is a facility
-		// introduced in Java 1.5
 		try {
-			String str = new String(codePointArray, 0, codePointArray.length);
-			rs.add(new XSString(str));
+			String str = UTF16.newString(codePointArray, 0, codePointArray.length);
+			return new XSString(str);
 		} catch (IllegalArgumentException iae) {
 			// This should be duoble checked above, but rather safe than sorry
 			throw DynamicError.unsupported_codepoint(iae.getMessage());
 		}
-		
-		return rs;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCollection.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCollection.java
index 2716245..ac4f20c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCollection.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,22 +8,28 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moller - bug 281159 - fix document loading and resolving URIs 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-import org.w3c.dom.Document;
-
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.DocType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.w3c.dom.Document;
 
 /**
  * Summary: This function takes an xs:string as argument and returns a sequence
@@ -75,9 +81,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return collection(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return collection(args, ec);
 	}
 
 	/**
@@ -91,26 +96,19 @@
 	 *             Dynamic error.
 	 * @return Result of fn:doc operation.
 	 */
-	public static ResultSequence collection(Collection args, DynamicContext dc)
+	public static ResultSequence collection(Collection args, EvaluationContext ec)
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = null;
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		
+		String uri = DEFAULT_COLLECTION_URI;
 		if (argiter.hasNext()) {
 			arg1 = (ResultSequence) argiter.next();
-		} else {
-			return getCollection(DEFAULT_COLLECTION_URI, dc);
+			uri = ((XSString) arg1.first()).value();
 		}
-			
-
-		if (arg1.empty())
-			return ResultSequenceFactory.create_new();
-
-		String uri = ((XSString) arg1.first()).value();
-		
 		
 		try {
 			new URI(uri);
@@ -123,11 +121,11 @@
 		}
 		
 
-		URI resolved = dc.resolve_uri(uri);
+		URI resolved = ec.getDynamicContext().resolveUri(uri);
 		if (resolved == null)
 			throw DynamicError.invalid_doc(null);
 
-		rs = getCollection(uri, dc);
+		ResultSequence rs = getCollection(uri, ec);
 		if (rs.empty())
 			throw DynamicError.doc_not_found(null);
 
@@ -149,15 +147,15 @@
 		return _expected_args;
 	}
 	
-	private static ResultSequence getCollection(String uri, DynamicContext dc) {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		Map<String, List<Document>> collectionMap = dc.get_collections();
-		List<Document> docList = collectionMap.get(uri);
+	private static ResultSequence getCollection(String uri, EvaluationContext ec) {
+		ResultBuffer rs = new ResultBuffer();
+		Map/*<String, List<Document>>*/ collectionMap = ec.getDynamicContext().getCollections();
+		List/*<Document>*/ docList = (List) collectionMap.get(uri);
 		for (int i = 0; i < docList.size(); i++) {
-			Document doc = docList.get(i);
-			rs.add(new DocType(doc, dc.getTypeModel(doc)));
+			Document doc = (Document) docList.get(i);
+			rs.add(new DocType(doc, ec.getStaticContext().getTypeModel()));
 		}
-		return rs;
+		return rs.getSequence();
 		
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCompare.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCompare.java
index 441279b..63c3bf6 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCompare.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCompare.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,19 +9,26 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * 
@@ -72,9 +79,8 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the comparison of the arguments.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return compare(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
+		return compare(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -88,23 +94,23 @@
 	 *             Dynamic error.
 	 * @return The result of the comparison of the arguments.
 	 */
-	public static ResultSequence compare(Collection args, DynamicContext dynamicContext) throws DynamicError {
+	public static ResultSequence compare(Collection args, DynamicContext context) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
 		ResultSequence arg2 = (ResultSequence) argiter.next();
 
-		String collationUri = dynamicContext.default_collation_name();
+		String collationUri = context.getCollationProvider().getDefaultCollation();
 		if (argiter.hasNext()) {
 			ResultSequence collArg = (ResultSequence) argiter.next();
-			collationUri = collArg.first().string_value();
+			collationUri = collArg.first().getStringValue();
 		}
 
 		XSString xstr1 = arg1.empty() ? null : (XSString) arg1.first();
 		XSString xstr2 = arg2.empty() ? null : (XSString) arg2.first();
 
-		BigInteger result = compare_string(collationUri, xstr1, xstr2, dynamicContext);
+		BigInteger result = compare_string(collationUri, xstr1, xstr2, context);
 		if (result != null) {
 			return ResultSequenceFactory.create_new(new XSInteger(result));
 		} else {
@@ -113,8 +119,8 @@
 	}
 
 	public static BigInteger compare_string(String collationUri, XSString xstr1,
-			XSString xstr2, DynamicContext dynamicContext) throws DynamicError {
-		Comparator collator = dynamicContext.get_collation(collationUri);
+			XSString xstr2, DynamicContext context) throws DynamicError {
+		Comparator collator = context.getCollationProvider().getCollation(collationUri);
 		if (collator == null) throw DynamicError.unsupported_collation(collationUri);
 
 		if (xstr1 == null || xstr2 == null) return null;
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnConcat.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnConcat.java
index 2b53fb6..f80ecdc 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnConcat.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnConcat.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,20 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * <p>
@@ -59,8 +63,7 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the concatenation of the arguments.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return concat(args);
 	}
 
@@ -79,7 +82,7 @@
 		if (args.size() < 2)
 			DynamicError.throw_type_error();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		String result = "";
 
@@ -98,15 +101,15 @@
 				continue;
 			}
 
-			AnyType at = arg.first();
+			Item at = arg.first();
 			
-			buf.append(at.string_value());
+			buf.append(at.getStringValue());
 
 		}
 		result = buf.toString();
 		
 		rs.add(new XSString(result));
 
-		return rs;
+		return rs.getSequence();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnContains.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnContains.java
index f72a969..80e7e66 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnContains.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnContains.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,21 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - STAR - bug 262765 - check for empty string in second arg before first. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns an xs:boolean indicating whether or not the value of $arg1 contains
@@ -45,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return contains(args);
 	}
 
@@ -62,8 +65,6 @@
 	public static ResultSequence contains(Collection args) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -80,21 +81,14 @@
 		int str2len = str2.length();
 
 		if (str2len == 0) {
-			rs.add(new XSBoolean(true));
-			return rs;
+			return XSBoolean.TRUE;
 		}
 		
 		if (str1len == 0) {
-			rs.add(new XSBoolean(false));
-			return rs;
+			return XSBoolean.FALSE;
 		}
 
-		if (str1.indexOf(str2) == -1)
-			rs.add(new XSBoolean(false));
-		else
-			rs.add(new XSBoolean(true));
-
-		return rs;
+		return XSBoolean.valueOf(str1.indexOf(str2) != -1);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCount.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCount.java
index 9a28baa..145ebd2 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCount.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCount.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns the number of items in the value of $arg. Returns 0 if $arg is the
@@ -40,8 +43,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return count(args);
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDate.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDate.java
index 2502531..7444e03 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDate.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,22 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper S Moller - bug 286452 - always return the stable date/time from dynamic context
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
 
 /**
  * Returns xs:date(fn:current-dateTime()). This is a xs:date (with timezone)
@@ -44,9 +49,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return current_date(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return current_date(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -64,7 +68,8 @@
 			throws DynamicError {
 		assert args.size() == 0;
 
-		AnyType res = new XSDate(dc.current_date_time(), dc.tz());
+		XSDayTimeDuration tz = new XSDayTimeDuration(dc.getTimezoneOffset());
+		AnyType res = new XSDate(dc.getCurrentDateTime(), tz);
 
 		return ResultSequenceFactory.create_new(res);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDateTime.java
index 26f94f6..3795fd9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,24 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper S Moller - bug 286452 - always return the stable date/time from dynamic context
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import javax.xml.datatype.Duration;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
 
 /**
  * Returns the xs:dateTime (with timezone) from the dynamic context. (See
@@ -45,9 +52,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return current_dateTime(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return current_dateTime(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -65,7 +71,10 @@
 			DynamicContext dc) throws DynamicError {
 		assert args.size() == 0;
 
-		AnyType res = new XSDateTime(dc.current_date_time(), dc.tz());
+		Duration d = dc.getTimezoneOffset();
+		XSDayTimeDuration tz = new XSDayTimeDuration(0, d.getHours(), d.getMinutes(), 0.0, d.getSign() == -1);
+
+		AnyType res = new XSDateTime(dc.getCurrentDateTime(), tz);
 
 		return ResultSequenceFactory.create_new(res);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentTime.java
index d5a9dd9..bdb0a8c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnCurrentTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,24 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper S Moller - bug 286452 - always return the stable date/time from dynamic context
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import javax.xml.datatype.Duration;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
 
 /**
  * Returns xs:time(fn:current-dateTime()). This is a xs:time (with timezone) that
@@ -44,9 +51,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return current_time(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return current_time(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -64,7 +70,10 @@
 			throws DynamicError {
 		assert args.size() == 0;
 
-		AnyType res = new XSTime(dc.current_date_time(), dc.tz());
+		Duration d = dc.getTimezoneOffset();
+		XSDayTimeDuration tz = new XSDayTimeDuration(0, d.getHours(), d.getMinutes(), 0.0, d.getSign() == -1);
+
+		AnyType res = new XSTime(dc.getCurrentDateTime(), tz);
 
 		return ResultSequenceFactory.create_new(res);
 	}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnData.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnData.java
index f4a6ddb..a3000b0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnData.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnData.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,16 +10,18 @@
  *     Mukul Gandhi - bug 276134 - improvements to schema aware primitive type support
  *                                 for attribute/element nodes 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.ListIterator;
 
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
@@ -48,8 +50,7 @@
 	 *            argument expressions.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 		// 1 argument only!
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
@@ -67,7 +68,7 @@
 	 */
 	public static ResultSequence atomize(ResultSequence arg) {
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		for (Iterator i = arg.iterator(); i.hasNext();) {
 			AnyType at = (AnyType) i.next();
@@ -83,31 +84,7 @@
 			}
 		}
 
-		return rs;
-	}
-
-	/**
-	 * Atomize a ResultSequnce argument expression.
-	 * 
-	 * @param arg
-	 *            input expression.
-	 */
-	public static void fast_atomize(ResultSequence arg) {
-		for (ListIterator i = arg.iterator(); i.hasNext();) {
-			AnyType at = (AnyType) i.next();
-
-			if (at instanceof AnyAtomicType) {
-				continue;
-			}
-
-			// XXX prolly wrong!
-			else if (at instanceof NodeType) {
-				NodeType nt = (NodeType) at;
-
-				i.set(nt.typed_value().first());
-			} else
-				assert false;
-		}
+		return rs.getSequence();
 	}
 
 	/**
@@ -117,13 +94,13 @@
 	 *            input expression.
 	 * @return Result of operation.
 	 */
-	public static AnyType atomize(AnyType arg) {
+	public static AnyType atomize(Item arg) {
 		if (arg instanceof AnyAtomicType)
-			return arg;
+			return (AnyAtomicType)arg;
 		else if (arg instanceof NodeType) {
 			NodeType nt = (NodeType) arg;
 
-			return nt.typed_value().first();
+			return (AnyType) nt.typed_value().first();
 		} else {
 			assert false;
 			return null;
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDateTime.java
index ceb5e9e..df71c01 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Mukul Gandhi, and others
+ * Copyright (c) 2009, 2010 Mukul Gandhi, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,27 @@
  * Contributors:
  *     Mukul Gandhi - bug 281822 - initial API and implementation
  *     David Carver - bug 282223 - implementation of xs:duration 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
 
 /**
   * A special constructor function for constructing a xs:dateTime value from a xs:date
@@ -45,9 +54,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return dateTime(args, static_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return dateTime(args, ec.getStaticContext());
 	}
 
 	/**
@@ -66,48 +74,44 @@
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
 		ResultSequence arg2 = (ResultSequence) argiter.next();
-		XSDate param1 = (XSDate)arg1.first();
-		XSTime param2 = (XSTime)arg2.first();
-		
+
 		// if either of the parameter is an empty sequence, the result
 		// is an empty sequence
-		if (param1 == null || param2 == null) {
-		  return rs;	
+		if (arg1.empty() || arg2.empty()) {
+			  return ResultBuffer.EMPTY;	
 		}
+		XSDate param1 = (XSDate)arg1.first();
+		XSTime param2 = (XSTime)arg2.first();
 		
 		Calendar cal = Calendar.getInstance();
 		cal.set(param1.year(), param1.month() - 1, param1.day());
 		cal.set(Calendar.HOUR_OF_DAY, param2.hour());
 		cal.set(Calendar.MINUTE, param2.minute());
-		cal.set(Calendar.SECOND, (Double.valueOf(Math.floor(param2.second())).intValue()));
+		cal.set(Calendar.SECOND, (new Double(Math.floor(param2.second())).intValue()));
 		cal.set(Calendar.MILLISECOND, 0);
 		
 		XSDuration dateTimeZone = param1.tz();
 		XSDuration timeTimeZone = param2.tz();
 		if ((dateTimeZone != null && timeTimeZone != null) &&
-		     !dateTimeZone.string_value().equals(timeTimeZone.string_value())) {
+		     !dateTimeZone.getStringValue().equals(timeTimeZone.getStringValue())) {
 		  // it's an error, if the arguments have different timezones
 		  throw DynamicError.inconsistentTimeZone();
 		} else if (dateTimeZone == null && timeTimeZone != null) {
-           rs.add(new XSDateTime(cal, timeTimeZone));
+           return new XSDateTime(cal, timeTimeZone);
 		} else if (dateTimeZone != null && timeTimeZone == null) {
-		   rs.add(new XSDateTime(cal, dateTimeZone));
+		   return new XSDateTime(cal, dateTimeZone);
 		}
 		else if ((dateTimeZone != null && timeTimeZone != null) &&
-			     dateTimeZone.string_value().equals(timeTimeZone.string_value())) {
-		   rs.add(new XSDateTime(cal, dateTimeZone));
+			     dateTimeZone.getStringValue().equals(timeTimeZone.getStringValue())) {
+		   return new XSDateTime(cal, dateTimeZone);
 		}
 		else {
-		   rs.add(new XSDateTime(cal, null));
+		   return new XSDateTime(cal, null);
 		}
-
-		return rs;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDate.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDate.java
index 90b31cb..39ff919 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDate.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer between 1 and 31, both inclusive, representing the day
@@ -44,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return day_from_date(args);
 	}
 
@@ -64,19 +67,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDate dt = (XSDate) arg1.first();
 
 		int res = dt.day();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDateTime.java
index d3e3d68..ab95837 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDayFromDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer between 1 and 31, both inclusive, representing the day
@@ -44,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return day_from_date_time(args);
 	}
 
@@ -64,19 +67,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDateTime dt = (XSDateTime) arg1.first();
 
 		int res = dt.day();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDaysFromDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDaysFromDuration.java
index 4383451..c5b5871 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDaysFromDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDaysFromDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,18 +10,22 @@
  *     Mukul Gandhi - bug 273760 - wrong namespace for functions and data types
  *     David Carver - bug 282223 - implementation of xs:duration.
  *     David Carver (STAR) - bug 262765 - fixed expected xs:duration argument. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer representing the days component in the canonical
@@ -47,8 +51,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return days_from_duration(args);
 	}
 
@@ -67,10 +70,8 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDuration dtd = (XSDuration) arg1.first();
@@ -80,9 +81,7 @@
 		if (dtd.negative())
 			res *= -1;
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDeepEqual.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDeepEqual.java
index ab3b089..7c572c9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDeepEqual.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDeepEqual.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,19 +8,28 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Moller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
-import org.w3c.dom.*;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.w3c.dom.Node;
 
 /**
  * The function assesses whether two sequences are deep-equal to each other. To
@@ -49,9 +58,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return deep_equal(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return deep_equal(args, ec);
 	}
 
 	/**
@@ -65,7 +73,7 @@
 	 *             Dynamic error.
 	 * @return Result of fn:deep-equal operation.
 	 */
-	public static ResultSequence deep_equal(Collection args, DynamicContext context)
+	public static ResultSequence deep_equal(Collection args, EvaluationContext context)
 			throws DynamicError {
 
 		// get args
@@ -73,11 +81,11 @@
 		ResultSequence arg1 = (ResultSequence) citer.next();
 		ResultSequence arg2 = (ResultSequence) citer.next();
 		ResultSequence arg3 = null;
-		String collationURI = context.default_collation_name();
+		String collationURI = context.getStaticContext().getCollationProvider().getDefaultCollation();
 		if (citer.hasNext()) {
 			arg3 = (ResultSequence) citer.next();
 			if (!arg3.empty()) {
-				collationURI = arg3.first().string_value();
+				collationURI = arg3.first().getStringValue();
 			}
 		}
 
@@ -97,7 +105,7 @@
 	 *            Current dynamic context 
 	 * @return Result of fn:deep-equal operation.
 	 */
-	public static boolean deep_equal(ResultSequence one, ResultSequence two, DynamicContext context, String collationURI) {
+	public static boolean deep_equal(ResultSequence one, ResultSequence two, EvaluationContext context, String collationURI) {
 		if (one.empty() && two.empty())
 			return true;
 
@@ -127,15 +135,15 @@
 	 * @param context 
 	 * @return Result of fn:deep-equal operation.
 	 */
-	public static boolean deep_equal(AnyType one, AnyType two, DynamicContext context, String collationURI) {
+	public static boolean deep_equal(AnyType one, AnyType two, EvaluationContext context, String collationURI) {
 		if ((one instanceof AnyAtomicType) && (two instanceof AnyAtomicType))
-			return deep_equal((AnyAtomicType) one, (AnyAtomicType) two, context, collationURI);
+			return deep_equal_atomic((AnyAtomicType) one, (AnyAtomicType) two, context.getDynamicContext(), collationURI);
 
 		else if (((one instanceof AnyAtomicType) && (two instanceof NodeType))
 				|| ((one instanceof NodeType) && (two instanceof AnyAtomicType)))
 			return false;
 		else if ((one instanceof NodeType) && (two instanceof NodeType))
-			return deep_equal((NodeType) one, (NodeType) two, context);
+			return deep_equal_node((NodeType) one, (NodeType) two, context);
 		else {
 			return false;
 		}
@@ -150,7 +158,7 @@
 	 *            input2 xpath expression/variable.
 	 * @return Result of fn:deep-equal operation.
 	 */
-	public static boolean deep_equal(AnyAtomicType one, AnyAtomicType two, DynamicContext context, String collationURI) {
+	public static boolean deep_equal_atomic(AnyAtomicType one, AnyAtomicType two, DynamicContext context, String collationURI) {
 		if (!(one instanceof CmpEq))
 			return false;
 		if (!(two instanceof CmpEq))
@@ -164,7 +172,7 @@
 				if (numeric.eq(two, context)) {
 					return true;
 				} else {
-					XSString value1 = new XSString(one.string_value());
+					XSString value1 = new XSString(one.getStringValue());
 					if (value1.eq(two, context)) {
 						return true;
 					}
@@ -175,8 +183,8 @@
 				return true;
 			
 			if (needsStringComparison(one, two)) {
-				XSString xstr1 = new XSString(one.string_value());
-				XSString xstr2 = new XSString(two.string_value());
+				XSString xstr1 = new XSString(one.getStringValue());
+				XSString xstr2 = new XSString(two.getStringValue());
 				if (FnCompare.compare_string(collationURI, xstr1, xstr2,
 						context).equals(BigInteger.ZERO)) {
 					return true;
@@ -197,7 +205,7 @@
 	 *            input2 xpath expression/variable.
 	 * @return Result of fn:deep-equal operation.
 	 */
-	public static boolean deep_equal(NodeType one, NodeType two, DynamicContext context) {
+	public static boolean deep_equal_node(NodeType one, NodeType two, EvaluationContext context) {
 		Node a = one.node_value();
 		Node b = two.node_value();
 		
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDefaultCollation.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDefaultCollation.java
index 5947096..d7e1ae0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDefaultCollation.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDefaultCollation.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,14 +9,15 @@
  *     David Carver (STAR) - initial API and implementation
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
 import java.util.Collection;
 
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
@@ -47,12 +48,9 @@
 		super(new QName("default-collation"), 0);
 	}
 
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		rs.add(new XSString(dynamic_context().default_collation_name()));
-		return rs;
+		return new XSString(ec.getDynamicContext().getCollationProvider().getDefaultCollation());
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDistinctValues.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDistinctValues.java
index f36ca01..bd6adea 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDistinctValues.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDistinctValues.java
@@ -10,8 +10,12 @@
  *     Jesper Moller - bug 280555 - Add pluggable collation support
  *     David Carver (STAR) - bug 262765 - fixed distinct-values comparison logic.
  *                           There is probably an easier way to do the comparison.
+<<<<<<< FnDistinctValues.java
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+=======
  *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *     Mukul Gandhi - bug 339025 - fixes to fn:distinct-values function. ability to find distinct values on node items.
+>>>>>>> 1.6
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -19,12 +23,13 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
@@ -53,8 +58,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return distinct_values(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return distinct_values(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -68,29 +73,29 @@
 	 */
 	public static ResultSequence distinct_values(Collection args, DynamicContext context) throws DynamicError {
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// get args
 		Iterator citer = args.iterator();
 		ResultSequence arg1 = (ResultSequence) citer.next();
-		ResultSequence arg2 = ResultSequenceFactory.create_new();
+		ResultSequence arg2 = ResultBuffer.EMPTY;
 		if (citer.hasNext()) {
 			arg2 = (ResultSequence) citer.next();
 		}
 		
-		String collationURI = context.default_collation_name();
+		String collationURI = context.getCollationProvider().getDefaultCollation();
 		if (!arg2.empty()) {
-			XSString collation = (XSString) arg2.first();
-			collationURI = collation.string_value();
+			XSString collation = (XSString) arg2.item(0);
+			collationURI = collation.getStringValue();
 		}
 
 		for (Iterator iter = arg1.iterator(); iter.hasNext();) {
-			AnyAtomicType atomizedItem = (AnyAtomicType) FnData.atomize((AnyType) iter.next());
+			AnyAtomicType atomizedItem = (AnyAtomicType) FnData.atomize((Item) iter.next());
 			if (!contains(rs, atomizedItem, context, collationURI))
 				rs.add(atomizedItem);
 		}
 
-		return rs;
+		return rs.getSequence();
 	}
 	
 	/**
@@ -104,8 +109,8 @@
 	 *             Dynamic error.
 	 * @return Result of operation.
 	 */
-	protected static boolean contains(ResultSequence rs, AnyAtomicType item,
-			DynamicContext context, String collationURI) throws DynamicError {
+	protected static boolean contains(ResultBuffer rs, AnyAtomicType item,
+			DynamicContext context, String collationURI)  {
 		if (!(item instanceof CmpEq))
 			return false;
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDoc.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDoc.java
index 00dca91..ef55fb8 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDoc.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDoc.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,19 +8,26 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moller - bug 281159 - fix document loading and resolving URIs 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.net.URI;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.DocType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.w3c.dom.Document;
 
 /**
  * Retrieves a document using an xs:anyURI supplied as an xs:string. If $uri is
@@ -53,9 +60,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return doc(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return doc(args, ec);
 	}
 
 	/**
@@ -69,7 +75,7 @@
 	 *             Dynamic error.
 	 * @return Result of fn:doc operation.
 	 */
-	public static ResultSequence doc(Collection args, DynamicContext dc)
+	public static ResultSequence doc(Collection args, EvaluationContext ec)
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
@@ -80,17 +86,18 @@
 		if (arg1.empty())
 			return ResultSequenceFactory.create_new();
 
-		String uri = ((XSString) arg1.first()).value();
+		String uri = ((XSString) arg1.item(0)).value();
 
-		URI resolved = dc.resolve_uri(uri);
+		DynamicContext dc = ec.getDynamicContext();
+		URI resolved = dc.resolveUri(uri);
 		if (resolved == null)
 			throw DynamicError.invalid_doc(null);
 
-		ResultSequence rs = dc.get_doc(resolved);
-		if (rs == null)
+		Document doc = dc.getDocument(resolved);
+		if (doc == null)
 			throw DynamicError.doc_not_found(null);
 
-		return rs;
+		return new DocType(doc, ec.getStaticContext().getTypeModel());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDocumentUri.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDocumentUri.java
index 42fc878..f2665bc 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDocumentUri.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnDocumentUri.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,22 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Mukul Gandhi - bug274731 - implementation of fn:document-uri function
  *     Jesper Moller- bug 281159 - fix document loading and resolving URIs 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.DocType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
 
 /**
  * Returns the value of the document-uri property for $arg as defined by the
@@ -48,8 +53,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return document_uri(args);
 	}
 
@@ -68,23 +72,22 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
 		if (arg1.empty())
-		  return rs;
+		  return ResultBuffer.EMPTY;
 
 		NodeType nt = (NodeType) arg1.first();
 
 		if (!(nt instanceof DocType))
-		  return rs;
+		  return ResultBuffer.EMPTY;
 
 		DocType dt = (DocType) nt;
 		String documentURI = dt.value().getDocumentURI();
 		
 		if (documentURI != null) {
 			XSAnyURI docUri = new XSAnyURI(documentURI);
-			rs.add(docUri);
+			return docUri;
 		}
-		return rs;
+		return ResultBuffer.EMPTY;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEmpty.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEmpty.java
index 46c189d..26dab8f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEmpty.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEmpty.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,18 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 
 /**
  * If the value of $arg is the empty sequence, the function returns true;
@@ -40,8 +42,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return empty(args);
 	}
 
@@ -58,17 +59,10 @@
 
 		assert args.size() == 1;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator citer = args.iterator();
 		ResultSequence arg1 = (ResultSequence) citer.next();
 
-		if (arg1.empty())
-			rs.add(new XSBoolean(true));
-		else
-			rs.add(new XSBoolean(false));
-
-		return rs;
+		return XSBoolean.valueOf(arg1.empty());
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEncodeForURI.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEncodeForURI.java
index 13645ce..e2c8f21 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEncodeForURI.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEncodeForURI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 David Carver, University College London, and others
+ * Copyright (c) 2009, 2010 David Carver, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,15 +8,17 @@
  * Contributors:
  *     David Carver - STAR - bug 285321 - initial api and implementation 
  *     Jesper Steen Moeller - bug 285319 - fix UTF-8 escaping
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * <p>
@@ -67,8 +69,7 @@
 	 * @return The evaluation of the arguments after application of the URI
 	 *         escaping rules.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		return escape_uri(args, true, true);
 	}
 	
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEndsWith.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEndsWith.java
index 5251723..1c67e57 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEndsWith.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEndsWith.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,21 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns an xs:boolean indicating whether or not the value of $arg1 ends with
@@ -43,8 +47,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return ends_with(args);
 	}
 
@@ -60,8 +63,6 @@
 	public static ResultSequence ends_with(Collection args) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -78,20 +79,13 @@
 		int str2len = str2.length();
 
 		if (str1len == 0 && str2len != 0) {
-			rs.add(new XSBoolean(false));
-			return rs;
+			return XSBoolean.FALSE;
 		}
 		if (str2len == 0) {
-			rs.add(new XSBoolean(true));
-			return rs;
+			return XSBoolean.TRUE;
 		}
 
-		if (str1.endsWith(str2))
-			rs.add(new XSBoolean(true));
-		else
-			rs.add(new XSBoolean(false));
-
-		return rs;
+		return XSBoolean.valueOf(str1.endsWith(str2));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnError.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnError.java
index c9b83ee..1e03643 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnError.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnError.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,21 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 28149 - add remaining fn:error functionality
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * The fn:error function causes the evaluation of the outermost XQuery or
@@ -51,8 +56,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		// Differentiate depending on whether there is one (required) argument or whatever.
 		Collection cargs = Function.convert_arguments(args, args.size() == 1 ? expected_args1() : expected_args());
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEscapeHTMLUri.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEscapeHTMLUri.java
index 9a25268..b3cdb45 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEscapeHTMLUri.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnEscapeHTMLUri.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,15 +10,17 @@
  *     David Carver - STAR - bug 262765 - renamed to correct function name. 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 285319 - fix UTF-8 escaping, and fix arity bug
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * <p>
@@ -103,8 +105,7 @@
 	 * @return The evaluation of the arguments after application of the URI
 	 *         escaping rules.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		return escape_uri(args, false, false);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExactlyOne.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExactlyOne.java
index 79d0d85..3e98f24 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExactlyOne.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExactlyOne.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,15 +7,17 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns $arg if it contains exactly one item. Otherwise, raises an error
@@ -38,8 +40,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return exactly_one(args);
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExists.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExists.java
index d020396..706e8f6 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExists.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnExists.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,16 +7,18 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 
 /**
  * If the value of $arg is not the empty sequence, the function returns true;
@@ -39,8 +41,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return exists(args);
 	}
 
@@ -57,17 +58,10 @@
 
 		assert args.size() == 1;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator citer = args.iterator();
 		ResultSequence arg1 = (ResultSequence) citer.next();
 
-		if (arg1.empty())
-			rs.add(new XSBoolean(false));
-		else
-			rs.add(new XSBoolean(true));
-
-		return rs;
+		return XSBoolean.valueOf(! arg1.empty());
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFalse.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFalse.java
index 0ba9b5d..1b8e7c3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFalse.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFalse.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,16 +7,18 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 
 /**
  * Returns the xs:boolean value false. Equivalent to xs:boolean("0").
@@ -38,8 +40,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return fn_false(args);
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFloor.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFloor.java
index 76659c1..6d23fc1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFloor.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnFloor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,18 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns the largest (closest to positive infinity) number with no fractional
@@ -46,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		// 1 argument only!
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
@@ -67,16 +68,14 @@
 	 */
 	public static ResultSequence fn_floor(ResultSequence arg)
 			throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		// sanity chex
 		NumericType nt = FnAbs.get_single_numeric_arg(arg);
 
 		// empty arg
 		if (nt == null)
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		rs.add(nt.floor());
-		return rs;
+		return nt.floor();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDateTime.java
index a4cb6b8..67014a2 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer between 0 and 23, both inclusive, representing the
@@ -44,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return hours_from_date_time(args);
 	}
 
@@ -64,19 +67,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDateTime dt = (XSDateTime) arg1.first();
 
 		int res = dt.hour();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDuration.java
index 855a712..f72dfef 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,18 +10,22 @@
  *     Mukul Gandhi - bug 273760 - wrong namespace for functions and data types
  *     David Carver - bug 282223 - implementation of xs:duration
  *     David Carver (STAR) - bug 262765 - fixed expected xs:duration argument. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer representing the hours component in the canonical
@@ -47,8 +51,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return hours_from_duration(args);
 	}
 
@@ -67,10 +70,8 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDuration dtd = (XSDuration) arg1.first();
@@ -80,9 +81,7 @@
 		if (dtd.negative())
 			res *= -1;
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromTime.java
index f0929e9..2fa4282 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnHoursFromTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
 
 /**
  * Returns an xs:integer between 0 and 23, both inclusive, representing the
@@ -44,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return hours_from_time(args);
 	}
 
@@ -64,19 +67,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSTime dt = (XSTime) arg1.first();
 
 		int res = dt.hour();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnID.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnID.java
index ec025d2..c7d23ce 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnID.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnID.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standard for Technology in Automotive Retail, and others
+ * Copyright (c) 2009, 2010 Standard for Technology in Automotive Retail, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,24 +8,34 @@
  * Contributors:
  * 	   David Carver (STAR) - bug 281168 - initial API and implementation
  *     David Carver  - bug 281186 - implementation of fn:id and fn:idref
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSIDREF;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import java.util.*;
-
 /**
  * Returns the sequence of element nodes that have an ID value matching the value of one
  * or more of the IDREF values supplied in $arg .
@@ -49,9 +59,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return id(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return id(args, ec);
 	}
 
 	/**
@@ -63,14 +72,14 @@
 	 *             Dynamic error.
 	 * @return Result of fn:insert-before operation.
 	 */
-	public static ResultSequence id(Collection args, DynamicContext context) throws DynamicError {
+	public static ResultSequence id(Collection args, EvaluationContext context) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 		
 		Iterator argIt = cargs.iterator();
 		ResultSequence idrefRS = (ResultSequence) argIt.next();
-		String[] idrefst = idrefRS.first().string_value().split(" ");
+		String[] idrefst = idrefRS.first().getStringValue().split(" ");
 
 		ArrayList idrefs = createIDRefs(idrefst);
 		ResultSequence nodeArg = null;
@@ -79,13 +88,13 @@
 			nodeArg = (ResultSequence) argIt.next();
 			nodeType = (NodeType)nodeArg.first();
 		} else {
-			if (context.context_item() == null) {
+			if (context.getContextItem() == null) {
 				throw DynamicError.contextUndefined();
 			}
-			if (!(context.context_item() instanceof NodeType)) {
+			if (!(context.getContextItem() instanceof NodeType)) {
 				throw new DynamicError(TypeError.invalid_type(null));
 			}
-			nodeType = (NodeType) context.context_item();
+			nodeType = (NodeType) context.getContextItem();
 			if (nodeType.node_value().getOwnerDocument() == null) {
 				throw DynamicError.contextUndefined();
 			}
@@ -99,14 +108,14 @@
 		}
 		
 		if (hasIDREF(idrefs, node)) {
-			ElementType element = new ElementType((Element) node, context.getTypeModel(node));
+			ElementType element = new ElementType((Element) node, context.getStaticContext().getTypeModel());
 			rs.add(element);
 		}
 		
-		rs = processAttributes(node, idrefs, rs, context);
-		rs = processChildNodes(node, idrefs, rs, context);
+		processAttributes(node, idrefs, rs, context);
+		processChildNodes(node, idrefs, rs, context);
 
-		return rs;
+		return rs.getSequence();
 	}
 	
 	private static ArrayList createIDRefs(String[] idReftokens) {
@@ -118,62 +127,59 @@
 		return xsidRef;
 	}
 	
-	private static ResultSequence processChildNodes(Node node, List idrefs, ResultSequence rs, DynamicContext dc) {
+	private static void processChildNodes(Node node, List idrefs, ResultBuffer rs, EvaluationContext context) {
 		if (!node.hasChildNodes()) {
-			return rs;
+			return;
 		}
 		
 		NodeList nodeList = node.getChildNodes();
 		for (int nodecnt = 0; nodecnt < nodeList.getLength(); nodecnt++) {
 			Node childNode = nodeList.item(nodecnt);
 			if (childNode.getNodeType() == Node.ELEMENT_NODE && !isDuplicate(childNode, rs)) {
-				ElementType element = new ElementType((Element)childNode, dc.getTypeModel(node));
+				ElementType element = new ElementType((Element)childNode, context.getStaticContext().getTypeModel());
 				if (element.isID()) {
 					if (hasIDREF(idrefs, childNode)) {
 						rs.add(element);
 					}
 				} 
-				rs = processAttributes(childNode, idrefs, rs, dc);
-				rs = processChildNodes(childNode, idrefs, rs, dc);
+				processAttributes(childNode, idrefs, rs, context);
+				processChildNodes(childNode, idrefs, rs, context);
 			}
 		}
-		
-		return rs;
 
 	}
 	
-	private static ResultSequence processAttributes(Node node, List idrefs, ResultSequence rs, DynamicContext dc) {
+	private static void processAttributes(Node node, List idrefs, ResultBuffer rs, EvaluationContext context) {
 		if (!node.hasAttributes()) {
-			return rs;
+			return;
 		}
 		
 		NamedNodeMap attributeList = node.getAttributes();
 		for (int atsub = 0; atsub < attributeList.getLength(); atsub++) {
 			Attr atNode = (Attr) attributeList.item(atsub);
-			NodeType atType = new AttrType(atNode, dc.getTypeModel(atNode));
+			NodeType atType = new AttrType(atNode, context.getStaticContext().getTypeModel());
 			if (atType.isID()) {
 				if (hasIDREF(idrefs, atNode)) {
 					if (!isDuplicate(node, rs)) {
-						ElementType element = new ElementType((Element)node, dc.getTypeModel(node));
+						ElementType element = new ElementType((Element)node, context.getStaticContext().getTypeModel());
 						rs.add(element);
 					}
 				}
 			}
 		}
-		return rs;
 	}
 	
 	private static boolean hasIDREF(List idrefs, Node node) {
 		for (int i = 0; i < idrefs.size(); i++) {
 			XSIDREF idref = (XSIDREF) idrefs.get(i);
-			if (idref.string_value().equals(node.getNodeValue())) {
+			if (idref.getStringValue().equals(node.getNodeValue())) {
 				return true;
 			}
 		}
 		return false;
 	}
 	
-	private static boolean isDuplicate(Node node, ResultSequence rs) {
+	private static boolean isDuplicate(Node node, ResultBuffer rs) {
 		Iterator it = rs.iterator();
 		while (it.hasNext()) {
 			if (it.next().equals(node)) {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIDREF.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIDREF.java
index fb4d372..679c0aa 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIDREF.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIDREF.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standard for Technology in Automotive Retail, and others
+ * Copyright (c) 2009, 2010 Standard for Technology in Automotive Retail, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,25 +8,34 @@
  * Contributors:
  * 	   David Carver (STAR) - bug 281168 - initial API and implementation
  *     David Carver  - bug 281186 - implementation of fn:id and fn:idref
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSID;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import java.util.*;
-
 /**
  * 
  */
@@ -49,9 +58,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return idref(args, dynamic_context(), dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return idref(args, ec);
 	}
 
 	/**
@@ -64,14 +72,14 @@
 	 *             Dynamic error.
 	 * @return Result of fn:insert-before operation.
 	 */
-	public static ResultSequence idref(Collection args, DynamicContext context, DynamicContext dc) throws DynamicError {
+	public static ResultSequence idref(Collection args, EvaluationContext ec) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 		
 		Iterator argIt = cargs.iterator();
 		ResultSequence idrefRS = (ResultSequence) argIt.next();
-		String[] idst = idrefRS.first().string_value().split(" ");
+		String[] idst = idrefRS.first().getStringValue().split(" ");
 
 		ArrayList ids = createIDs(idst);
 		ResultSequence nodeArg = null;
@@ -80,13 +88,13 @@
 			nodeArg = (ResultSequence) argIt.next();
 			nodeType = (NodeType)nodeArg.first();
 		} else {
-			if (context.context_item() == null) {
+			if (ec.getContextItem() == null) {
 				throw DynamicError.contextUndefined();
 			}
-			if (!(context.context_item() instanceof NodeType)) {
+			if (!(ec.getContextItem() instanceof NodeType)) {
 				throw new DynamicError(TypeError.invalid_type(null));
 			}
-			nodeType = (NodeType) context.context_item();
+			nodeType = (NodeType) ec.getContextItem();
 			if (nodeType.node_value().getOwnerDocument() == null) {
 				throw DynamicError.contextUndefined();
 			}
@@ -100,14 +108,14 @@
 		}
 		
 		if (hasID(ids, node)) {
-			ElementType element = new ElementType((Element) node, dc.getTypeModel(node));
+			ElementType element = new ElementType((Element) node, ec.getStaticContext().getTypeModel());
 			rs.add(element);
 		}
 		
-		rs = processAttributes(node, ids, rs, dc);
-		rs = processChildNodes(node, ids, rs, dc);
+		rs = processAttributes(node, ids, rs, ec);
+		rs = processChildNodes(node, ids, rs, ec);
 
-		return rs;
+		return rs.getSequence();
 	}
 	
 	private static ArrayList createIDs(String[] idtokens) {
@@ -119,7 +127,7 @@
 		return xsid;
 	}
 	
-	private static ResultSequence processChildNodes(Node node, List ids, ResultSequence rs, DynamicContext dc) {
+	private static ResultBuffer processChildNodes(Node node, List ids, ResultBuffer rs, EvaluationContext ec) {
 		if (!node.hasChildNodes()) {
 			return rs;
 		}
@@ -128,14 +136,14 @@
 		for (int nodecnt = 0; nodecnt < nodeList.getLength(); nodecnt++) {
 			Node childNode = nodeList.item(nodecnt);
 			if (childNode.getNodeType() == Node.ELEMENT_NODE && !isDuplicate(childNode, rs)) {
-				ElementType element = new ElementType((Element)childNode, dc.getTypeModel(node));
+				ElementType element = new ElementType((Element)childNode, ec.getStaticContext().getTypeModel());
 				if (element.isIDREF()) {
 					if (hasID(ids, childNode)) {
 						rs.add(element);
 					}
 				} 
-				rs = processAttributes(childNode, ids, rs, dc);
-				rs = processChildNodes(childNode, ids, rs, dc);
+				rs = processAttributes(childNode, ids, rs, ec);
+				rs = processChildNodes(childNode, ids, rs, ec);
 			}
 		}
 		
@@ -143,7 +151,7 @@
 
 	}
 	
-	private static ResultSequence processAttributes(Node node, List idrefs, ResultSequence rs, DynamicContext dc) {
+	private static ResultBuffer processAttributes(Node node, List idrefs, ResultBuffer rs, EvaluationContext ec) {
 		if (!node.hasAttributes()) {
 			return rs;
 		}
@@ -151,11 +159,11 @@
 		NamedNodeMap attributeList = node.getAttributes();
 		for (int atsub = 0; atsub < attributeList.getLength(); atsub++) {
 			Attr atNode = (Attr) attributeList.item(atsub);
-			NodeType atType = new AttrType(atNode, dc.getTypeModel(atNode));
+			NodeType atType = new AttrType(atNode, ec.getStaticContext().getTypeModel());
 			if (atType.isID()) {
 				if (hasID(idrefs, atNode)) {
 					if (!isDuplicate(node, rs)) {
-						ElementType element = new ElementType((Element)node, dc.getTypeModel(node));
+						ElementType element = new ElementType((Element)node, ec.getStaticContext().getTypeModel());
 						rs.add(element);
 					}
 				}
@@ -167,14 +175,14 @@
 	private static boolean hasID(List ids, Node node) {
 		for (int i = 0; i < ids.size(); i++) {
 			XSID idref = (XSID) ids.get(i);
-			if (idref.string_value().equals(node.getNodeValue())) {
+			if (idref.getStringValue().equals(node.getNodeValue())) {
 				return true;
 			}
 		}
 		return false;
 	}
 	
-	private static boolean isDuplicate(Node node, ResultSequence rs) {
+	private static boolean isDuplicate(Node node, ResultBuffer rs) {
 		Iterator it = rs.iterator();
 		while (it.hasNext()) {
 			if (it.next().equals(node)) {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnImplicitTimezone.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnImplicitTimezone.java
index 3e78493..d9ab088 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnImplicitTimezone.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnImplicitTimezone.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,21 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 273760 - wrong namespace for functions and data types
  *     David Carver - bug 282223 - implementation of xs:duration 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
 
 /**
  * Returns the value of the implicit timezone property from the dynamic context.
@@ -43,9 +47,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return implicit_timezone(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return implicit_timezone(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -63,13 +66,8 @@
 			DynamicContext dc) throws DynamicError {
 		assert args.size() == 0;
 
-		try {
-			AnyType res = (XSDuration) dc.tz().clone();
+		AnyType res = new XSDayTimeDuration(dc.getTimezoneOffset());
 
-			return ResultSequenceFactory.create_new(res);
-		} catch (CloneNotSupportedException err) {
-			assert false;
-			return null;
-		}
+		return ResultSequenceFactory.create_new(res);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInScopePrefixes.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInScopePrefixes.java
index f709d78..cecdf63 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInScopePrefixes.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInScopePrefixes.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail and others
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,24 +7,32 @@
  *
  * Contributors:
  *     David Carver  - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.XMLConstants;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
-import java.util.*;
-
-import javax.xml.XMLConstants;
-
 /**
  * Returns the in-scope-prefixes for the element and any of it's ancestors.
  */
@@ -47,9 +55,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return inScopePrefixes(args, _fl.dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return inScopePrefixes(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -66,25 +73,25 @@
 //		Collection cargs = Function.convert_arguments(args, expected_args());
 		Collection cargs = args;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
 		if (arg1.empty())
-		  return rs;
+		  return ResultBuffer.EMPTY;
+
+		ResultBuffer rs = new ResultBuffer();
 		
-		AnyType anytype = arg1.first();
+		Item anytype = arg1.item(0);
 		if (!(anytype instanceof ElementType)) {
 			throw new DynamicError(TypeError.invalid_type(null));
 		}
 
-		ElementType element = (ElementType) arg1.first();
+		ElementType element = (ElementType) anytype;
 		List prefixList = lookupPrefixes(element);
 		createPrefixResultSet(rs, prefixList);
-		return rs;
+		return rs.getSequence();
 	}
 
-	private static void createPrefixResultSet(ResultSequence rs, List prefixList) {
+	private static void createPrefixResultSet(ResultBuffer rs, List prefixList) {
 		for (int i = 0; i < prefixList.size(); i++) {
 			String prefix = (String) prefixList.get(i);
 			rs.add(new XSString(prefix));
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIndexOf.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIndexOf.java
index e0d8649..108d46d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIndexOf.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIndexOf.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Moller - bug 280555 - Add pluggable collation support
  *     David Carver (STAR) - bug 262765 - fixed collation and comparison issues.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -18,10 +19,11 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
@@ -57,9 +59,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return index_of(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
+		return index_of(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -73,7 +74,7 @@
 	 */
 	private static CmpEq get_comparable(AnyType at) throws DynamicError {
 		if (at instanceof NodeType) {
-			XSString nodeString = new XSString(at.string_value());
+			XSString nodeString = new XSString(at.getStringValue());
 			return nodeString;
 		}
 		
@@ -96,33 +97,32 @@
 	 *             Dynamic error.
 	 * @return Result of fn:index-of operation.
 	 */
-	public static ResultSequence index_of(Collection args, DynamicContext dynamicContext) throws DynamicError {
+	public static ResultSequence index_of(Collection args, DynamicContext dc) {
 		Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator citer = args.iterator();
 		ResultSequence arg1 = (ResultSequence) citer.next();
 		ResultSequence arg2 = (ResultSequence) citer.next();
 		
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		// sanity chex
 		if (arg2.size() != 1)
 			DynamicError.throw_type_error();
 		
-		String collationUri = dynamicContext.default_collation_name();
+		String collationUri = dc.getCollationProvider().getDefaultCollation();
 		if (citer.hasNext()) {
 			ResultSequence arg3 = (ResultSequence) citer.next();
 			if (!arg3.empty()) {
 				XSString collation = (XSString) arg3.first();
-				collationUri = collation.string_value();
+				collationUri = collation.getStringValue();
 			}
 		}
 
+		ResultBuffer rb = new ResultBuffer();
 		AnyAtomicType at = (AnyAtomicType)arg2.first();
 
 		get_comparable(at);
@@ -138,37 +138,37 @@
 			
 			if (isBoolean(cmptype, at)) {
 				XSBoolean boolat = (XSBoolean) cmptype;
-				if (boolat.eq(at, dynamicContext)) {
- 				   rs.add(new XSInteger(BigInteger.valueOf(index)));
+				if (boolat.eq(at, dc)) {
+ 				   rb.add(new XSInteger(BigInteger.valueOf(index)));
 				}
 			} else 
 			
 			if (isNumeric(cmptype, at)) {
 				NumericType numericat = (NumericType) at;
-				if (numericat.eq(cmptype, dynamicContext)) {
-					rs.add(new XSInteger(BigInteger.valueOf(index)));
+				if (numericat.eq(cmptype, dc)) {
+					rb.add(new XSInteger(BigInteger.valueOf(index)));
 				}
 			} else
 			
 			if (isDuration(cmptype, at)) {
 				XSDuration durat = (XSDuration) at;
-				if (durat.eq(cmptype, dynamicContext)) {
-					rs.add(new XSInteger(BigInteger.valueOf(index)));
+				if (durat.eq(cmptype, dc)) {
+					rb.add(new XSInteger(BigInteger.valueOf(index)));
 				}
 			} else
 			
 			if (needsStringComparison(cmptype, at)) {
-				XSString xstr1 = new XSString(cmptype.string_value());
-				XSString itemStr = new XSString(at.string_value());
-				if (FnCompare.compare_string(collationUri, xstr1, itemStr, dynamicContext).equals(BigInteger.ZERO)) {
-					rs.add(new XSInteger(BigInteger.valueOf(index)));
+				XSString xstr1 = new XSString(cmptype.getStringValue());
+				XSString itemStr = new XSString(at.getStringValue());
+				if (FnCompare.compare_string(collationUri, xstr1, itemStr, dc).equals(BigInteger.ZERO)) {
+					rb.add(new XSInteger(BigInteger.valueOf(index)));
 				}
 			} 
 			
 			index++;
 		}
 
-		return rs;
+		return rb.getSequence();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInsertBefore.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInsertBefore.java
index 74465b0..e415901 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInsertBefore.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnInsertBefore.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,22 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns a new sequence constructed from the value of $target with the value
@@ -41,8 +47,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 		return insert_before(args);
 	}
 
@@ -60,7 +65,7 @@
 
 		assert args.size() == 3;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// get args
 		Iterator citer = args.iterator();
@@ -72,7 +77,7 @@
 		if (arg2.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg2.first();
+		Item at = arg2.first();
 		if (!(at instanceof XSInteger))
 			DynamicError.throw_type_error();
 
@@ -106,6 +111,6 @@
 		if (curpos == position)
 			rs.concat(inserts);
 
-		return rs;
+		return rs.getSequence();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIriToURI.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIriToURI.java
index 5feab4f..cf43fad 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIriToURI.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnIriToURI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail and others
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,14 +9,16 @@
  *     David Carver - STAR - bug 262765 - renamed to correct function name. 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 285319 - fix UTF-8 escaping
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
 import java.util.Collection;
 
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 public class FnIriToURI extends AbstractURIFunction {
@@ -35,8 +37,7 @@
 	 * @return The evaluation of the arguments after application of the URI
 	 *         escaping rules.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		return escape_uri(args, false, true);
 	}	
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLang.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLang.java
index f82fbbc..0957787 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLang.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLang.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,19 +10,27 @@
  *     David Carver (STAR) - bug 280972 - fix fn:lang implementation so it matches spec. 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     David Carver (STAR) - bug 262765 - correct invalidType to throw XPTY0004 instead of FORG0006
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
-import org.w3c.dom.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
 
 /**
  * This function tests whether the language of $node, or the context node if the
@@ -53,9 +61,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return lang(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return lang(args, ec);
 	}
 
 	/**
@@ -67,22 +74,19 @@
 	 *             Dynamic error.
 	 * @return Result of fn:lang operation.
 	 */
-	public static ResultSequence lang(Collection args, DynamicContext context) throws DynamicError {
+	public static ResultSequence lang(Collection args, EvaluationContext ec) throws DynamicError {
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get arg
 		Iterator citer = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) citer.next();
 		ResultSequence arg2 = null;
 		if (cargs.size() == 1) {
-			if (context.context_item() == null) {
+			if (ec.getContextItem() == null) {
 				throw DynamicError.contextUndefined();
 			}
-			arg2 = ResultSequenceFactory.create_new();
-			arg2.add(context.context_item());
+			arg2 = (AnyType) ec.getContextItem();
 		} else {
 			arg2 = (ResultSequence) citer.next();
 		}
@@ -100,9 +104,7 @@
 		
 		NodeType an = (NodeType) arg2.first();
 
-		rs.add(new XSBoolean(test_lang(an.node_value(), lang)));
-
-		return rs;
+		return new XSBoolean(test_lang(an.node_value(), lang));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLast.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLast.java
index 70fcf69..1d8ad10 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLast.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLast.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer indicating the number of items in the sequence of items
@@ -42,9 +44,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return last(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return last(args, ec);
 	}
 
 	/**
@@ -58,15 +59,15 @@
 	 *             Dynamic error.
 	 * @return Result of fn:last operation.
 	 */
-	public static ResultSequence last(Collection args, DynamicContext dc)
+	public static ResultSequence last(Collection args, EvaluationContext ec)
 			throws DynamicError {
 		assert args.size() == 0;
 		
-		if (dc.focus() == null || dc.context_item() == null) {
+		if (ec.getContextItem() == null) {
 			throw DynamicError.contextUndefined();
 		}
 
-		int last = dc.last();
+		int last = ec.getLastPosition();
 
 		assert last != 0;
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalName.java
index 1482e81..5473c16 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,18 +9,22 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - STAR - bug 262765 - fixed implementation of fn:local-name according to spec.  
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns the local part of the name of $arg as an xs:string that will either
@@ -45,9 +49,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return local_name(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return local_name(args, ec);
 	}
 
 	/**
@@ -59,22 +62,19 @@
 	 *             Dynamic error.
 	 * @return Result of fn:local-name operation.
 	 */
-	public static ResultSequence local_name(Collection args, DynamicContext context)
+	public static ResultSequence local_name(Collection args, EvaluationContext context)
 			throws DynamicError {
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get arg
 		ResultSequence arg1 = null;
 		
 		if (cargs.isEmpty()) {
-			if (context.context_item() == null)
+			if (context.getContextItem() == null)
 				throw DynamicError.contextUndefined();
 			else {
-				arg1 = ResultSequenceFactory.create_new();
-				arg1.add(context.context_item());
+				arg1 = (AnyType) context.getContextItem();
 			}
 		} else {
 			arg1 = (ResultSequence) cargs.iterator().next();
@@ -82,8 +82,7 @@
 		}
 		
 		if (arg1.empty()) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		NodeType an = (NodeType) arg1.first();
@@ -95,9 +94,7 @@
 		if (name != null)
 			sname = name.local();
 
-		rs.add(new XSString(sname));
-
-		return rs;
+		return new XSString(sname);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalNameFromQName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalNameFromQName.java
index b6942b3..62502ea 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalNameFromQName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLocalNameFromQName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName;
 
 /**
  * Returns an xs:NCNAME representing the local part of $arg. If $arg is the
@@ -42,8 +45,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return local_name(args);
 	}
 
@@ -61,19 +63,15 @@
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get arg
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
 		if (arg1.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		QName qname = (QName) arg1.first();
 
-		rs.add(new XSNCName(qname.local()));
-
-		return rs;
+		return new XSNCName(qname.local());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLowerCase.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLowerCase.java
index 1a17b44..573b071 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLowerCase.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnLowerCase.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,19 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 282096 - improvements for surrogate handling  
  *     Jesper Steen Moeller - bug 282096 - clean up string storage
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * <p>
@@ -60,8 +62,7 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the arguments being converted to lower case.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return lower_case(args);
 	}
 
@@ -80,18 +81,13 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		String str = ((XSString) arg1.first()).value();
 
-		rs.add(new XSString(str.toLowerCase()));
-
-		return rs;
+		return new XSString(str.toLowerCase());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMatches.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMatches.java
index b950c42..9684b55 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMatches.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMatches.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,18 +10,22 @@
  *     David Carver - bug 282096 - improvements for surrogate handling
  *     David Carver - bug 262765 - improvements to Regular Expression   
  *     Jesper Steen Moeller - bug 282096 - clean up string storage
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.regex.PatternSyntaxException;
 
-import java.util.*;
-import java.util.regex.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * The function returns true if $input matches the regular expression supplied
@@ -47,8 +51,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return matches(args);
 	}
 
@@ -64,8 +67,6 @@
 	public static ResultSequence matches(Collection args) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -81,7 +82,7 @@
 		if (argiter.hasNext()) {
 			ResultSequence flagRS = null;
 			flagRS = (ResultSequence) argiter.next();
-			flags = flagRS.first().string_value();
+			flags = flagRS.first().getStringValue();
 			if (validflags.indexOf(flags) == -1 && flags.length() > 0 ) {
 				throw DynamicError.regex_flags_error(null);
 			}
@@ -90,8 +91,7 @@
 		try {
 			boolean result = false;
 			result = matches(pattern, flags, str1);
-			rs.add(new XSBoolean(result));
-			return rs;
+			return XSBoolean.valueOf(result);
 		} catch (PatternSyntaxException pex) {
 			throw DynamicError.regex_error(pex.getMessage());
 		}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMax.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMax.java
index 826fb36..251d85f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMax.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMax.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
  *     Jesper Moller - bug 280555 - Add pluggable collation support
  *     David Carver (STAR) - bug 262765 - fixed promotion issue
  *     Jesper Moller - bug 281028 - fix promotion rules for fn:max
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -17,9 +18,10 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
@@ -52,9 +54,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return max(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
+		return max(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -68,7 +69,7 @@
 	 *             Dynamic error.
 	 * @return Result of fn:max operation.
 	 */
-	public static ResultSequence max(Collection args, DynamicContext context) throws DynamicError {
+	public static ResultSequence max(Collection args, DynamicContext dynamicContext) throws DynamicError {
 
 		ResultSequence arg = get_arg(args, CmpGt.class);
 		if (arg.empty())
@@ -85,7 +86,7 @@
 			if (conv instanceof XSDouble && ((XSDouble)conv).nan() || conv instanceof XSFloat && ((XSFloat)conv).nan()) {
 				return ResultSequenceFactory.create_new(tp.promote(new XSFloat(Float.NaN)));
 			}
-			if (max == null || ((CmpGt)conv).gt((AnyType)max, context)) {
+			if (max == null || ((CmpGt)conv).gt((AnyType)max, dynamicContext)) {
 				max = (CmpGt)conv;
 			}
 		}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMin.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMin.java
index d243075..3db14a3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMin.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
  *     Jesper Moller - bug 280555 - Add pluggable collation support
  *     David Carver (STAR) - bug 262765 - fixed promotion issue 
  *     Jesper Moller - bug 281028 - fix promotion rules for fn:min
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -17,9 +18,10 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
@@ -52,9 +54,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return min(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return min(args, ec.getDynamicContext());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDateTime.java
index 65e3f48..2ee1c48 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer value between 0 and 59, both inclusive, representing
@@ -44,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return minutes_from_date_time(args);
 	}
 
@@ -64,19 +67,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDateTime dt = (XSDateTime) arg1.first();
 
 		int res = dt.minute();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDuration.java
index b817260..4895b55 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,18 +10,22 @@
  *     Mukul Gandhi - bug 273760 - wrong namespace for functions and data types
  *     David Carver (STAR) - bug 282223 - implementation of xs:duration
  *     David Carver (STAR) - bug 262765 - fixed expected args for fnMinutesFromDuration 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer representing the minutes component in the canonical
@@ -47,8 +51,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return minutes_from_duration(args);
 	}
 
@@ -67,10 +70,8 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDuration dtd = (XSDuration) arg1.first();
@@ -80,9 +81,7 @@
 		if (dtd.negative())
 			res *= -1;
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromTime.java
index b467f80..3c1b3b1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMinutesFromTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
 
 /**
  * Returns an xs:integer value between 0 to 59, both inclusive, representing the
@@ -44,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return minutes_from_time(args);
 	}
 
@@ -64,19 +67,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSTime dt = (XSTime) arg1.first();
 
 		int res = dt.minute();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDate.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDate.java
index 15dd087..b824623 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDate.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer between 1 and 12, both inclusive, representing the
@@ -44,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return month_from_date(args);
 	}
 
@@ -64,19 +67,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDate dt = (XSDate) arg1.first();
 
 		int res = dt.month();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDateTime.java
index bc8ff6d..fc49c00 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthFromDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,22 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer between 1 and 12, both inclusive, representing the
@@ -45,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return month_from_date_time(args);
 	}
 
@@ -65,19 +68,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDateTime dt = (XSDateTime) arg1.first();
 
 		int res = dt.month();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthsFromDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthsFromDuration.java
index f427bb8..5f60e82 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthsFromDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnMonthsFromDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,18 +11,22 @@
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type
  *     David Carver - bug 282223 - implementation of xs:duration. 
  *     David Carver (STAR) - bug 262765 - fixed expected xs:duration argument
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer representing the months component in the canonical
@@ -48,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return months_from_duration(args);
 	}
 
@@ -68,10 +71,8 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDuration ymd = (XSDuration) arg1.first();
@@ -81,9 +82,7 @@
 		if (ymd.negative())
 			res *= -1;
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnName.java
index 9c31f17..5c36d99 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,18 +11,22 @@
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Mukul Gandhi - bug 301539 - fixed "context undefined" bug in case of zero
  *                                 arity.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns the name of a node, as an xs:string that is either the zero-length
@@ -47,9 +51,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return name(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return name(args, ec);
 	}
 
 	/**
@@ -63,29 +66,25 @@
 	 *             Dynamic error.
 	 * @return Result of fn:name operation.
 	 */
-	public static ResultSequence name(Collection args, DynamicContext context) throws DynamicError {
+	public static ResultSequence name(Collection args, EvaluationContext ec) throws DynamicError {
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get arg
 		ResultSequence arg1 = null;
 		
 		if (cargs.isEmpty()) {
-			if (context.context_item() == null)
+			if (ec.getContextItem() == null)
 				throw DynamicError.contextUndefined();
 			else {
-				arg1 = ResultSequenceFactory.create_new();
-				arg1.add(context.context_item());
+				arg1 = ResultBuffer.wrap(ec.getContextItem());
 			}
 		} else {
 			arg1 = (ResultSequence) cargs.iterator().next();
 		}
 		
 		if (arg1.empty()) {
-		   rs.add(new XSString(""));
-		   return rs;
+		   return new XSString("");
 		}
 
 		NodeType an = (NodeType) arg1.first();
@@ -94,11 +93,9 @@
 
 		String sname = "";
 		if (name != null)
-		  sname = name.string_value();
+		  sname = name.getStringValue();
 
-		rs.add(new XSString(sname));
-
-		return rs;
+		return new XSString(sname);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUri.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUri.java
index 95e1557..1c2ed8d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUri.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUri.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,18 +9,22 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 262765 - corrected implementation according to spec. 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
 
 /**
  * Returns the namespace URI of the xs:QName of $arg.
@@ -44,9 +48,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return namespace_uri(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return namespace_uri(args, ec);
 	}
 
 	/**
@@ -59,26 +62,23 @@
 	 * @return Result of fn:namespace-uri operation.
 	 */
 	public static ResultSequence namespace_uri(Collection args,
-			DynamicContext context) throws DynamicError {
+			EvaluationContext context) throws DynamicError {
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
 		ResultSequence arg1 = null;
 		if (cargs.isEmpty()) {
-			if (context.context_item() == null) {
+			if (context.getContextItem() == null) {
 				throw DynamicError.contextUndefined();
 			}
-			arg1 = ResultSequenceFactory.create_new();
-			arg1.add(context.context_item());
+			arg1 = (AnyType) context.getContextItem();
 		} else {
 			// get arg
 			arg1 = (ResultSequence) cargs.iterator().next();
 		}
 
 		if (arg1.empty()) {
-			rs.add(new XSAnyURI(""));
-			return rs;
+			return new XSAnyURI("");
 		}
 
 		NodeType an = (NodeType) arg1.first();
@@ -89,9 +89,7 @@
 		if (name != null)
 			sname = name.namespace();
 
-		rs.add(new XSAnyURI(sname));
-
-		return rs;
+		return new XSAnyURI(sname);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUriFromQName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUriFromQName.java
index 25711c3..6018f54 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUriFromQName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNamespaceUriFromQName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
 
 /**
  * Returns the namespace URI for $arg as an xs:string. If $arg is the empty
@@ -43,8 +46,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return namespace(args);
 	}
 
@@ -61,13 +63,11 @@
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get arg
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
 		if (arg1.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		QName qname = (QName) arg1.first();
 
@@ -75,9 +75,7 @@
 
 		if (ns == null)
 			ns = "";
-		rs.add(new XSAnyURI(ns));
-
-		return rs;
+		return new XSAnyURI(ns);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNilled.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNilled.java
index 4377c0a..e2f4425 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNilled.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNilled.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,19 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns an xs:boolean indicating whether the argument node is "nilled". If
@@ -42,8 +45,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return nilled(args);
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNodeName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNodeName.java
index 37c530d..cd50cf0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNodeName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNodeName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns an expanded-QName for node kinds that can have names. For other kinds
@@ -43,8 +46,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return node_name(args);
 	}
 
@@ -60,21 +62,17 @@
 	public static ResultSequence node_name(Collection args) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 		if (arg1.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		NodeType nt = (NodeType) arg1.first();
 
 		QName nodename = nt.node_name();
 		if (nodename == null)
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		rs.add(nodename);
-
-		return rs;
+		return nodename;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeSpace.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeSpace.java
index e306924..8f0a951 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeSpace.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeSpace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,18 +11,20 @@
  *     David Carver (STAR) - bug 262765 - correct implementation to correctly get context node 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moller  - bug 281938 - handle context and empty sequences correctly
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * <p>
@@ -64,9 +66,8 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the space in the arguments being normalized.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return normalize_space(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return normalize_space(args, ec);
 	}
 
 	/**
@@ -78,7 +79,7 @@
 	 *             Dynamic error.
 	 * @return The result of normalizing the space in the arguments.
 	 */
-	public static ResultSequence normalize_space(Collection args, DynamicContext d_context)
+	public static ResultSequence normalize_space(Collection args, EvaluationContext ec)
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
@@ -86,19 +87,17 @@
 		
 		if (cargs.isEmpty()) {
 		  // support for arity = 0
-		  arg1 = getResultSetForArityZero(d_context);
+		  arg1 = getResultSetForArityZero(ec);
 		}
 		else {
 		  arg1 = (ResultSequence) cargs.iterator().next();
 		}
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
 		String str = "";
 		if (! arg1.empty()) {
 			str = ((XSString) arg1.first()).value();
 		} 
-		rs.add(new XSString(normalize(str)));
-		return rs;
+		return new XSString(normalize(str));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeUnicode.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeUnicode.java
index a045c7c..e3326f0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeUnicode.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNormalizeUnicode.java
@@ -8,22 +8,21 @@
  * Contributors:
  *     Jesper Steen Moeller - bug 285152 - implement fn:normalize-unicocde
  *     Jesper Steen Moller  - bug 290337 - Revisit use of ICU
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
@@ -68,7 +67,7 @@
 	 */
 	static class ICUNormalizer implements W3CNormalizer {
 		
-		private Map<String, Normalizer.Mode> modeMap = new HashMap<String, Normalizer.Mode>();
+		private Map modeMap = new HashMap();
 		{
 			// Can't handle "FULLY-NORMALIZED" yet
 			
@@ -80,7 +79,7 @@
 		
 		public String normalize(String argument, String normalizationForm)
 				throws DynamicError {
-			Normalizer.Mode mode = modeMap.get(normalizationForm);
+			Normalizer.Mode mode = (Normalizer.Mode)modeMap.get(normalizationForm);
 			if (mode != null) {
 				return Normalizer.normalize(argument, mode);
 			} else {
@@ -89,11 +88,12 @@
 		}
 	}
 
+	/*
 	static class JDK6Normalizer implements W3CNormalizer {
 		private Method normalizeMethod;
-		private Map<String, Enum> formMap = new HashMap<String, Enum>();
+		private Map formMap = new HashMap();
 
-		public JDK6Normalizer(Class<?> normalizerCls, Class<? extends Enum> formCls) throws SecurityException, NoSuchMethodException {
+		public JDK6Normalizer(Class normalizerCls, Class formCls) throws SecurityException, NoSuchMethodException {
 			this.normalizeMethod = normalizerCls.getMethod("normalize", CharSequence.class, formCls);
 			Enum[] formConstants = formCls.getEnumConstants();
 			for (Enum form : formConstants) {
@@ -124,6 +124,7 @@
 			}			
 		}
 	}
+	*/
 
 	static class FailingNormalizer implements W3CNormalizer {
 		
@@ -142,9 +143,8 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the space in the arguments being normalized.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return normalize_unicode(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return normalize_unicode(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -180,11 +180,8 @@
 		String argument = "";
 		if (! arg1.empty()) argument = ((XSString) arg1.first()).value();
 				
-		ResultSequence rs = ResultSequenceFactory.create_new();
 		String normalized = normalizationType.equals("") ? argument : getNormalizer().normalize(argument, normalizationType);
-		rs.add(new XSString(normalized));
-		
-		return rs;
+		return new XSString(normalized);
 	}
 
 	private static W3CNormalizer getNormalizer() {
@@ -192,9 +189,11 @@
 			ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 			
 			normalizer = createICUNormalizer(classLoader);
+			/*
 			if (normalizer == null) {
 				normalizer = createJDKNormalizer(classLoader);
 			}
+			*/
 			if (normalizer == null) {
 				normalizer = new FailingNormalizer();
 			}
@@ -202,11 +201,12 @@
 		return normalizer;
 	}
 
+	/*
 	private static W3CNormalizer createJDKNormalizer(ClassLoader classLoader) {
 		// If that fails, we'll check for the Java 6 Normalizer class
 		try {
-			Class<?> normalizerClass = classLoader.loadClass("java.text.Normalizer");
-			Class<? extends Enum> formClass = (Class<? extends Enum>) classLoader.loadClass("java.text.Normalizer$Form");
+			Class normalizerClass = classLoader.loadClass("java.text.Normalizer");
+			Class formClass = classLoader.loadClass("java.text.Normalizer$Form");
 			
 			return new JDK6Normalizer(normalizerClass, formClass);
 		} catch (ClassNotFoundException e) {
@@ -215,6 +215,7 @@
 		}
 		return null;
 	}
+	*/
 
 	private static W3CNormalizer createICUNormalizer(ClassLoader classLoader) {
 		// First attempt is to try the IBM ICU library
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNot.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNot.java
index 5214283..9bc709f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNot.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNot.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,16 +9,18 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moller  - bug 262765 - propagate possible errors from xs:boolean
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 
 /**
  * $arg is first reduced to an effective boolean value by applying the
@@ -41,8 +43,7 @@
 	 * @return Result of evaluation.
 	 * @throws DynamicError 
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		// 1 argument only!
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNumber.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNumber.java
index 09a79c5..256fb12 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNumber.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnNumber.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,18 +11,23 @@
  *     Jesper Steen Moeller - bug 262765 - fixes float handling for fn:number 
  *     Mukul Gandhi - bug 298519 - improvements to fn:number implementation,
  *                                 catering to node arguments. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
 
 /**
  * Returns the value indicated by $arg or, if $arg is not specified, the context
@@ -48,21 +53,18 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		ResultSequence argument = null;
 		if (args.isEmpty()) {
-			argument = getResultSetForArityZero(dynamic_context());
+			argument = getResultSetForArityZero(ec);
 		} else {
 			argument = (ResultSequence) args.iterator().next();
 		}
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		rs.add(fn_number(argument, dynamic_context()));
-		return rs;
+		return fn_number(argument, ec);
 	}
 
 	/**
@@ -76,13 +78,13 @@
 	 *             Dynamic error.
 	 * @return Result of fn:number operation.
 	 */
-	public static XSDouble fn_number(ResultSequence arg, DynamicContext dc)
+	public static XSDouble fn_number(ResultSequence arg, EvaluationContext ec)
 			throws DynamicError {
 
 		if (arg.size() > 1) {
 			throw new DynamicError(TypeError.invalid_type("bad argument passed to fn:number()"));
 		} else if (arg.size() == 1) {
-			AnyType at = arg.first();
+			Item at = arg.first();
 
 			/*
 			if (!(at instanceof AnyAtomicType))
@@ -104,12 +106,12 @@
 					  return new XSDouble((double)value); 
 				  }
 			  } else {
-				 XSDouble d = XSDouble.parse_double(at.string_value());
+				 XSDouble d = XSDouble.parse_double(at.getStringValue());
 				 return d != null ? d : new XSDouble(Double.NaN);
 			  }
 			}
 			else if (at instanceof NodeType) {
-				XSDouble d = XSDouble.parse_double((FnData.atomize(at)).string_value());
+				XSDouble d = XSDouble.parse_double((FnData.atomize(at)).getStringValue());
 				return d != null ? d : new XSDouble(Double.NaN);
 			}
 		} else {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnOneOrMore.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnOneOrMore.java
index 9e03bdc..93c29af 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnOneOrMore.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnOneOrMore.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,15 +7,17 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns $arg if it contains one or more items. Otherwise, raises an error
@@ -38,8 +40,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return one_or_more(args);
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPosition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPosition.java
index f6b7ca3..19b8e31 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPosition.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPosition.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,20 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer indicating the position of the context item within the
@@ -43,9 +45,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return position(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return position(args, ec);
 	}
 
 	/**
@@ -59,15 +60,15 @@
 	 *             Dynamic error.
 	 * @return Result of fn:position operation.
 	 */
-	public static ResultSequence position(Collection args, DynamicContext dc)
+	public static ResultSequence position(Collection args, EvaluationContext ec)
 			throws DynamicError {
 		assert args.size() == 0;
 
-		if (dc.focus().context_item() == null) {
+		if (ec.getContextItem() == null) {
 			throw DynamicError.contextUndefined();
 		}
 		
-		return ResultSequenceFactory.create_new(new XSInteger(BigInteger.valueOf(dc
-				.context_position())));
+		return ResultSequenceFactory.create_new(new XSInteger(BigInteger.valueOf(ec
+				.getContextPosition())));
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPrefixFromQName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPrefixFromQName.java
index b3d9385..a98e1a1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPrefixFromQName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnPrefixFromQName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Mukul Gandhi, and others
+ * Copyright (c) 2009, 2010 Mukul Gandhi, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,24 @@
  *
  * Contributors:
  *     Mukul Gandhi - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import javax.xml.XMLConstants;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName;
 
 /**
  * Returns an xs:NCName representing the prefix for $arg. If $arg is the empty
@@ -43,9 +49,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return prefix(args, _fl.dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
+		return prefix(args, ec.getStaticContext());
 	}
 
 	/**
@@ -57,32 +62,28 @@
 	 *             Dynamic error.
 	 * @return Result of fn:prefix-from-QName operation.
 	 */
-	public static ResultSequence prefix(Collection args, DynamicContext dc) throws DynamicError {
+	public static ResultSequence prefix(Collection args, StaticContext sc) throws DynamicError {
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get arg
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
 		if (arg1.empty())
-		  return rs;
+		  return ResultBuffer.EMPTY;
 
 		QName qname = (QName) arg1.first();
 
 		String prefix = qname.prefix();
 		
-
 		if (prefix != null) {
-			if (dc.prefix_exists(prefix)) {
-				  rs.add(new XSNCName(prefix));
+			if (! XMLConstants.NULL_NS_URI.equals(sc.getNamespaceContext().getNamespaceURI(prefix))) {
+				  return new XSNCName(prefix);
 			} else {
 				throw DynamicError.invalidPrefix();
 			}
 		} 
-
-		return rs;
+		return ResultBuffer.EMPTY;
 	}
 	
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnQName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnQName.java
index 9e0827a..e8c54e4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnQName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnQName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,22 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI
@@ -46,9 +50,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return resolve_QName(args, static_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return resolve_QName(args, ec.getStaticContext());
 	}
 
 	/**
@@ -67,8 +70,6 @@
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -84,9 +85,7 @@
 			throw DynamicError.lexical_error(null);
 		qn.set_namespace(ns);
 
-		rs.add(qn);
-
-		return rs;
+		return qn;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRemove.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRemove.java
index 110b1c2..21af06d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRemove.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRemove.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,21 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns a new sequence constructed from the value of $target with the item at
@@ -45,8 +50,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return remove(args);
 	}
 
@@ -63,7 +67,7 @@
 
 		assert args.size() == 2;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// get args
 		Iterator citer = args.iterator();
@@ -74,7 +78,7 @@
 		if (arg2.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg2.first();
+		Item at = arg2.first();
 		if (!(at instanceof XSInteger))
 			DynamicError.throw_type_error();
 
@@ -87,7 +91,7 @@
 			return target;
 
 		if (target.empty())
-			return rs;
+			return rs.getSequence();
 
 		int curpos = 1;
 
@@ -100,6 +104,6 @@
 			curpos++;
 		}
 
-		return rs;
+		return rs.getSequence();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReplace.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReplace.java
index bbe3450..c97ab08 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReplace.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReplace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,18 +9,21 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver (STAR) - bug 262765 - added exception handling to toss correct error numbers. 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.regex.PatternSyntaxException;
 
-import java.util.*;
-import java.util.regex.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * The function returns the xs:string that is obtained by replacing each
@@ -46,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return replace(args);
 	}
 
@@ -63,8 +65,6 @@
 	public static ResultSequence replace(Collection args) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -77,7 +77,7 @@
 		ResultSequence arg4 = null;
 		if (argiter.hasNext()) {
 			arg4 = (ResultSequence) argiter.next();
-			String flags = arg4.first().string_value();
+			String flags = arg4.first().getStringValue();
 			
 			if (flags.length() == 0) {
 				arg4 = null;
@@ -89,8 +89,7 @@
 		String replacement = ((XSString) arg3.first()).value();
 		
 		try {
-			rs.add(new XSString(str1.replaceAll(pattern, replacement)));
-			return rs; 
+			return new XSString(str1.replaceAll(pattern, replacement));
 		} catch (PatternSyntaxException err) {
 			throw DynamicError.regex_error(null);
 		} catch (IllegalArgumentException ex) {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveQName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveQName.java
index 0341601..c9f670c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveQName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveQName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,19 +8,25 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     David Carver (STAR) - bug 288886 - add unit tests and fix fn:resolve-qname function
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-import org.w3c.dom.Element;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.w3c.dom.Element;
 
 /**
  * Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string
@@ -47,9 +53,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return resolve_QName(args, static_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return resolve_QName(args, ec.getStaticContext());
 	}
 
 	/**
@@ -69,14 +74,12 @@
 		//Collection cargs = Function.convert_arguments(args, expected_args());
 		Collection cargs = args;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
 
 		if (arg1.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 		
 		ResultSequence arg2 = (ResultSequence) argiter.next();
 
@@ -104,9 +107,7 @@
 		}
 		
 
-		rs.add(qn);
-
-		return rs;
+		return qn;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveURI.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveURI.java
index 7a4ef61..f005036 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveURI.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnResolveURI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Standards for Technology in Automotive Retail and others
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,18 +7,24 @@
  *
  * Contributors:
  *     David Carver - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
 import java.net.URI;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
 
 /**
  * The purpose of this function is to enable a relative URI to be resolved
@@ -55,9 +61,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return resolveURI(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return resolveURI(args, ec);
 	}
 
 	/**
@@ -72,8 +77,8 @@
 	 * @return Result of fn:resolve-uri operation.
 	 */
 	public static ResultSequence resolveURI(Collection args,
-			DynamicContext d_context) throws DynamicError {
-		if (d_context.base_uri() == null) {
+			EvaluationContext ec) throws DynamicError {
+		if (ec.getStaticContext().getBaseUri() == null) {
 			throw DynamicError.noBaseURI();
 		}
 		
@@ -85,25 +90,21 @@
 			baseUriRS = (ResultSequence) argit.next();
 		}
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		
 		if (relativeRS.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
-		AnyType relativeURI = relativeRS.first();
+		Item relativeURI = relativeRS.first();
 		String resolvedURI = null;
 				
 		if (baseUriRS == null) {
-			resolvedURI = resolveURI(d_context.base_uri().string_value(), relativeURI.string_value());
+			resolvedURI = resolveURI(ec.getStaticContext().getBaseUri().toString(), relativeURI.getStringValue());
 		} else {
-			AnyType baseURI = baseUriRS.first();
-			resolvedURI = resolveURI(baseURI.string_value(), relativeURI.string_value());
+			Item baseURI = baseUriRS.first();
+			resolvedURI = resolveURI(baseURI.getStringValue(), relativeURI.getStringValue());
 		}
 
-		rs.add(new XSAnyURI(resolvedURI));
-
-		return rs;
+		return new XSAnyURI(resolvedURI);
 	}
 
 	private static String resolveURI(String base, String relative) throws DynamicError {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReverse.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReverse.java
index d070198..d9e734d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReverse.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnReverse.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,16 +7,18 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * <p>
@@ -50,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the reversal of the arguments.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return reverse(args);
 	}
 
@@ -68,24 +69,18 @@
 
 		assert args.size() == 1;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator citer = args.iterator();
 		ResultSequence arg = (ResultSequence) citer.next();
 
-		if (arg.empty())
-			return rs;
+		if (arg.size() <= 1)
+			return arg;
 
-		// XXX lame
-		ListIterator i = arg.iterator();
+		ResultBuffer rs = new ResultBuffer();
 
-		while (i.hasNext())
-			i.next();
+		for (int i = arg.size()-1; i >= 0; --i)
+			rs.add(arg.item(i));
 
-		while (i.hasPrevious())
-			rs.add((AnyType) i.previous());
-
-		return rs;
+		return rs.getSequence();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoot.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoot.java
index f3088ed..c559180 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoot.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoot.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,20 +11,26 @@
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 281159 - tak extra care to find the root 
  *     Jesper Steen Moller - bug 275610 - Avoid big time and memory overhead for externals
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
-import java.util.*;
-
-import org.w3c.dom.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
 
 /**
  * Returns the root of the tree to which $arg belongs. This will usually, but
@@ -49,14 +55,13 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		//ResultSequence argument = (ResultSequence) args.iterator().next();
 
-		return fn_root(args, dynamic_context());
+		return fn_root(args, ec);
 	}
 
 	/**
@@ -70,36 +75,28 @@
 	 *             Dynamic error.
 	 * @return Result of fn:root operation.
 	 */
-	public static ResultSequence fn_root(Collection args, DynamicContext dc)
-			throws DynamicError {
+	public static ResultSequence fn_root(Collection args, EvaluationContext ec) {
 
 		Collection cargs = Function.convert_arguments(args, expected_args());
 		
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		// sanity check arg
-//		if (cargs.isEmpty())
-//			return rs;
-
 		if (cargs.size() > 1)
 			throw new DynamicError(TypeError.invalid_type(null));
 		
 		ResultSequence arg = null;
 		if (cargs.isEmpty()) {
-			arg = ResultSequenceFactory.create_new();
-			if (dc.context_item() == null) {
+			if (ec.getContextItem() == null) {
 				throw DynamicError.contextUndefined();
 			}
-			arg.add(dc.context_item());
+			arg = ResultBuffer.wrap(ec.getContextItem());
 		} else {
 			arg = (ResultSequence) cargs.iterator().next();			
 		}
 		
 		if (arg.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 		
-		AnyType aa = arg.first();
+		Item aa = arg.item(0);
 
 		if (!(aa instanceof NodeType))
 			throw new DynamicError(TypeError.invalid_type(null));
@@ -107,7 +104,6 @@
 		NodeType nt = (NodeType) aa;
 
 		// ok we got a sane argument... own it.
-
 		Node root = nt.node_value();
 
 		while (root != null && ! (root instanceof Document)) {
@@ -123,9 +119,7 @@
 			root = newroot;
 		}
 
-		rs.add(NodeType.dom_to_xpath(root, dc.getTypeModel(root)));
-
-		return rs;
+		return NodeType.dom_to_xpath(root, ec.getStaticContext().getTypeModel());
 	}
 	
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRound.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRound.java
index 3d505e6..fb80fd1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRound.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRound.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,18 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns the number with no fractional part that is closest to the argument.
@@ -45,8 +47,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		// 1 argument only!
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
@@ -66,16 +67,14 @@
 	 */
 	public static ResultSequence fn_round(ResultSequence arg)
 			throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		// sanity chex
 		NumericType nt = FnAbs.get_single_numeric_arg(arg);
 
 		// empty arg
 		if (nt == null)
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		rs.add(nt.round());
-		return rs;
+		return nt.round();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoundHalfToEven.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoundHalfToEven.java
index 09e068e..1aba459 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoundHalfToEven.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnRoundHalfToEven.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,20 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * The value returned is the nearest (that is, numerically closest) numeric to
@@ -47,8 +50,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		ResultSequence argument = (ResultSequence) args.iterator().next();
 		if (args.size() == 2) {
 			return fn_round_half_to_even(args);
@@ -68,16 +70,14 @@
 	 */
 	public static ResultSequence fn_round_half_to_even(ResultSequence arg)
 			throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		NumericType nt = FnAbs.get_single_numeric_arg(arg);
 
 		// empty arg
 		if (nt == null)
-			return rs;
+			return ResultBuffer.EMPTY;
 		
-		rs.add(nt.round_half_to_even());
-		return rs;
+		return nt.round_half_to_even();
 	}
 	
 	public static ResultSequence fn_round_half_to_even(Collection args) throws DynamicError {
@@ -93,10 +93,6 @@
 		NumericType nt = (NumericType) rsArg1.first();
 		NumericType ntPrecision = (NumericType) rsPrecision.first();
 		
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		
-		rs.add(nt.round_half_to_even(Integer.parseInt(ntPrecision.string_value())));
-		return rs;
-
+		return nt.round_half_to_even(Integer.parseInt(ntPrecision.getStringValue()));
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDateTime.java
index 3a8c1b1..7cc1518 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,22 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 277774 - XSDEcimal returning wrong values. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal;
 
 /**
  * Returns an xs:decimal value between 0 and 60.999..., both inclusive
@@ -48,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return seconds_from_date_time(args);
 	}
 
@@ -68,19 +71,13 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDateTime dt = (XSDateTime) arg1.first();
-
 		double res = dt.second();
-
-		rs.add(new XSDecimal(BigDecimal.valueOf(res)));
-
-		return rs;
+		return new XSDecimal(new BigDecimal(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDuration.java
index 7727678..46bc2f5 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,18 +11,22 @@
  *     David Carver - bug 277774 - XSDecimal returning wrong values.
  *     David Carver - bug 282223 - implementation of xs:duration
  *     David Carver (STAR) - bug 262765 - fixed xs:duration expected argument. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
 
 /**
  * Returns an xs:decimal representing the seconds component in the canonical
@@ -48,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return seconds_from_duration(args);
 	}
 
@@ -68,10 +71,8 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDuration dtd = (XSDuration) arg1.first();
@@ -81,9 +82,7 @@
 		if (dtd.negative())
 			res *= -1;
 
-		rs.add(new XSDecimal(BigDecimal.valueOf(res)));
-
-		return rs;
+		return new XSDecimal(new BigDecimal(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromTime.java
index 3a5db3b..9f68efe 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSecondsFromTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,22 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 277774 - XSDecimal returing wrong values. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
 
 /**
  * Returns an xs:decimal value between 0 and 60.999..., both inclusive,
@@ -48,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return seconds_from_time(args);
 	}
 
@@ -68,19 +71,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSTime dt = (XSTime) arg1.first();
 
 		double res = dt.second();
 
-		rs.add(new XSDecimal(BigDecimal.valueOf(res)));
-
-		return rs;
+		return new XSDecimal(new BigDecimal(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStartsWith.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStartsWith.java
index 0942683..14eb9a3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStartsWith.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStartsWith.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,21 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns an xs:boolean indicating whether or not the value of $arg1 starts
@@ -43,8 +47,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return starts_with(args);
 	}
 
@@ -61,8 +64,6 @@
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -79,20 +80,13 @@
 		int str2len = str2.length();
 
 		if (str1len == 0 && str2len != 0) {
-			rs.add(new XSBoolean(false));
-			return rs;
+			return XSBoolean.FALSE;
 		}
 		if (str2len == 0) {
-			rs.add(new XSBoolean(true));
-			return rs;
+			return XSBoolean.TRUE;
 		}
 
-		if (str1.startsWith(str2))
-			rs.add(new XSBoolean(true));
-		else
-			rs.add(new XSBoolean(false));
-
-		return rs;
+		return XSBoolean.valueOf(str1.startsWith(str2));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStaticBaseUri.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStaticBaseUri.java
index a50a3fc..83f1b52 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStaticBaseUri.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStaticBaseUri.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
 
 /**
  * Returns the value of the base-uri property from the static context. If the
@@ -42,9 +45,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return static_base_uri(args, static_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return static_base_uri(args, ec.getStaticContext());
 	}
 
 	/**
@@ -64,6 +66,6 @@
 		assert sc != null;
 
 		// make a copy prolly
-		return ResultSequenceFactory.create_new(sc.base_uri());
+		return ResultSequenceFactory.create_new(new XSAnyURI(sc.getBaseUri().toString()));
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnString.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnString.java
index 71f6a97..a0b0267 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnString.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnString.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,18 +10,21 @@
  *     Mukul Gandhi - bug 274471 - improvements to fn:string function (support for arity 0) 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moller  - bug 281938 - handle context and empty sequences correctly
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns the value of $arg represented as a xs:string. If no argument is
@@ -44,9 +47,8 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return string(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return string(args, ec);
 	}
 
 	/**
@@ -58,7 +60,7 @@
 	 *             Dynamic error.
 	 * @return Result of fn:string operation.
 	 */
-	public static ResultSequence string(Collection args, DynamicContext d_context) throws DynamicError {
+	public static ResultSequence string(Collection args, EvaluationContext ec) throws DynamicError {
 
 		assert (args.size() == 0 || args.size() == 1);
 
@@ -66,7 +68,7 @@
 				
 		if (args.isEmpty()) {
 			// support for arity = 0
-			return getResultSetForArityZero(d_context);
+			return getResultSetForArityZero(ec);
 		}
 		else {
 			arg1 = (ResultSequence) args.iterator().next();	
@@ -76,15 +78,15 @@
 		if (arg1.size() > 1)
 			throw new DynamicError(TypeError.invalid_type(null));
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 		if (arg1.empty()) {
 			rs.add(new XSString(""));
 		} else {
-			AnyType at = arg1.first();
-			rs.add(new XSString(at.string_value()));
+			Item at = arg1.first();
+			rs.add(new XSString(at.getStringValue()));
 		}
 		
-		return rs;
+		return rs.getSequence();
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringJoin.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringJoin.java
index 3fd093b..1a40460 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringJoin.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringJoin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * <p>
@@ -59,8 +62,7 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the joining of the arguments.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return string_join(args);
 	}
 
@@ -81,8 +83,6 @@
 		ResultSequence arg1 = (ResultSequence) argi.next();
 		ResultSequence arg2 = (ResultSequence) argi.next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		String result = "";
 		String separator = ((XSString) arg2.first()).value();
 
@@ -96,9 +96,7 @@
 		}
 		
 		result = buf.toString();
-		rs.add(new XSString(result));
-
-		return rs;
+		return new XSString(result);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringLength.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringLength.java
index 3f2d094..bd29904 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringLength.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringLength.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,19 +13,24 @@
  *     David Carver - bug 282096 - improvements for surrogate handling 
  *     Jesper Steen Moeller - bug 282096 - clean up string storage
  *     Jesper Steen Moller  - bug 281938 - handle context and empty sequences correctly
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+
+import com.ibm.icu.text.UTF16;
 
 /**
  * <p>
@@ -64,9 +69,8 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the string length of the arguments.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
-		return string_length(args, dynamic_context());
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
+		return string_length(args, ec);
 	}
 
 	/**
@@ -78,7 +82,7 @@
 	 *             Dynamic error.
 	 * @return The result of obtaining the string length from the arguments.
 	 */
-	public static ResultSequence string_length(Collection args, DynamicContext d_context)
+	public static ResultSequence string_length(Collection args, EvaluationContext ec)
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
@@ -86,7 +90,7 @@
 
 		if (cargs.isEmpty()) {
 		  // support for arity = 0
-		  return getResultSetForArityZero(d_context);
+		  return getResultSetForArityZero(ec);
 		}
 		else {
 		  arg1 = (ResultSequence) cargs.iterator().next();
@@ -96,10 +100,7 @@
 		if (! arg1.empty()) {
 			str = ((XSString) arg1.first()).value();
 		}
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		rs.add(new XSInteger(BigInteger.valueOf(str.codePointCount(0, str.length()))));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(UTF16.countCodePoint(str)));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringToCodepoints.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringToCodepoints.java
index 1cd53df..bbab33b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringToCodepoints.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnStringToCodepoints.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,21 +10,25 @@
  *     Mukul Gandhi - bug 280554 - improvements to the function implementation
  *     David Carver - bug 282096 - improvements for surrogate handling  
  *     Jesper Steen Moeller - bug 282096 - clean up string storage and fix surrogate handling
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.CodePointIterator;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.StringCodePointIterator;
 
-import java.math.BigInteger;
-import java.util.*;
-
 /**
  * Returns the sequence of code points that constitute an xs:string. If $arg is
  * a zero-length string or the empty sequence, the empty sequence is returned.
@@ -48,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return string_to_codepoints(args);
 	}
 
@@ -66,21 +69,20 @@
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 		if (arg1.empty())
-		   return rs;
+		   return ResultBuffer.EMPTY;
 
 		XSString xstr = (XSString) arg1.first();
 
 		CodePointIterator cpi = new StringCodePointIterator(xstr.value());
 		
+		ResultBuffer rs = new ResultBuffer();
 		for (int codePoint = cpi.current(); codePoint != CodePointIterator.DONE; codePoint = cpi.next()) {
            	rs.add(new XSInteger(BigInteger.valueOf(codePoint)));
 		}
-
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubsequence.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubsequence.java
index b8a442f..86ad4cd 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubsequence.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubsequence.java
@@ -18,9 +18,10 @@
 import java.util.Collection;
 import java.util.Iterator;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
@@ -51,7 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return subsequence(args);
 	}
 
@@ -65,14 +66,14 @@
 	 * @return Result of fn:subsequence operation.
 	 */
 	public static ResultSequence subsequence(Collection args) throws DynamicError {		
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// get args
 		Iterator citer = args.iterator();
 		
 		ResultSequence seq = (ResultSequence) citer.next();		
 		if (seq.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 		
 		ResultSequence startLoc = (ResultSequence) citer.next();
 		ResultSequence length = null; 		
@@ -80,12 +81,12 @@
 			length = (ResultSequence) citer.next(); 
 		}
 
-		AnyType at = startLoc.first();
+		Item at = startLoc.first();
 		if (!(at instanceof NumericType)) {
 			DynamicError.throw_type_error();
 		}
 
-		at = new XSDouble(at.string_value());
+		at = new XSDouble(at.getStringValue());
 
 		int start = (int) ((XSDouble) at).double_value();
         int effectiveNoItems = 0; // no of items beyond index >= 1 that are added to the result
@@ -98,7 +99,7 @@
 			if (!(at instanceof NumericType)) {
 				DynamicError.throw_type_error();
 			}
-			at = new XSDouble(at.string_value());
+			at = new XSDouble(at.getStringValue());
 			int len = (int) ((XSDouble) at).double_value();
 			if (len < 0) {
 				DynamicError.throw_type_error();	
@@ -136,8 +137,7 @@
 			}
 		}
 		
-		return rs;
-		
+		return rs.getSequence();
 	}
 	
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstring.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstring.java
index fca61f0..5d3bc91 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstring.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstring.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,19 +11,25 @@
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     David Carver - bug 282096 - improvements for surrogate handling 
  *     Jesper Steen Moeller - bug 282096 - reimplemented to be surrogate sensitive
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.CodePointIterator;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.StringCodePointIterator;
 
-import java.util.*;
+import com.ibm.icu.lang.UCharacter;
 
 /**
  * <p>
@@ -69,8 +75,7 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the substring obtained from the arguments.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return substring(args);
 	}
 
@@ -85,7 +90,6 @@
 	 */
 	public static ResultSequence substring(Collection args) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args(args));
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		Iterator argi = cargs.iterator();
 		ResultSequence stringArg = (ResultSequence) argi.next();
@@ -97,7 +101,7 @@
 		}
 
 		if (stringArg.empty()) {
-			return emptyString(rs);
+			return emptyString();
 		}
 
 		String str = ((XSString) stringArg.first()).value();
@@ -105,7 +109,7 @@
 		
 		// is start is NaN, no chars are returned
 		if (Double.isNaN(dstart) || Double.NEGATIVE_INFINITY == dstart) {
-			return emptyString(rs);
+			return emptyString();
 		}
 		long istart = Math.round(dstart);
 		
@@ -113,16 +117,16 @@
 		if (lengthArg != null) {
 			double dlength = ((XSDouble) lengthArg.first()).double_value();
 			if (Double.isNaN(dlength))
-				return emptyString(rs);
+				return emptyString();
 			// Switch to the rounded kind
 			ilength = Math.round(dlength);
 			if (ilength <= 0)
-				return emptyString(rs);
+				return emptyString();
 		}
 		
 		
 		// could guess too short in cases supplementary chars 
-		StringBuilder sb = new StringBuilder((int) Math.min(str.length(), ilength));
+		StringBuffer sb = new StringBuffer((int) Math.min(str.length(), ilength));
 
 		// This looks like an inefficient way to iterate, but due to surrogate handling,
 		// string indexes are no good here. Welcome to UTF-16!
@@ -130,16 +134,13 @@
 		CodePointIterator strIter = new StringCodePointIterator(str);
 		for (long p = 1; strIter.current() != CodePointIterator.DONE; ++p, strIter.next()) {
 			if (istart <= p && p - istart < ilength)
-				sb.appendCodePoint(strIter.current());
+			   sb.append(UCharacter.toChars(strIter.current()));
 		}
-		rs.add(new XSString(sb.toString()));
-
-		return rs;
+		return new XSString(sb.toString());
 	}
 	
-	private static ResultSequence emptyString(ResultSequence rs) {
-		rs.add(new XSString(""));
-		return rs;
+	private static ResultSequence emptyString() {
+		return new XSString("");
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringAfter.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringAfter.java
index 28a08f1..c5f8893 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringAfter.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringAfter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 282096 - improvements for surrogate handling  
  *     Jesper Steen Moeller - bug 282096 - clean up string storage
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns the substring of the value of $arg1 that follows in the value of
@@ -46,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return substring_after(args);
 	}
 
@@ -64,8 +66,6 @@
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -84,14 +84,12 @@
 		int str2len = str2.length();
 
 		if (str2len == 0) {
-			rs.add(new XSString(str1));
-			return rs;
+			return new XSString(str1);
 		}
 
 		int index = str1.indexOf(str2);
 		if (index == -1) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		String result = "";
@@ -101,9 +99,7 @@
 			result = str1.substring(index, str1len);
 		}
 
-		rs.add(new XSString(result));
-
-		return rs;
+		return new XSString(result);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringBefore.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringBefore.java
index 5b4d52e..1254cb4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringBefore.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSubstringBefore.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 282096 - improvements for surrogate handling  
  *     Jesper Steen Moeller - bug 282096 - clean up string storage
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * Returns the substring of the value of $arg1 that precedes in the value of
@@ -46,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return substring_before(args);
 	}
 
@@ -64,8 +66,6 @@
 			throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator argiter = cargs.iterator();
 		ResultSequence arg1 = (ResultSequence) argiter.next();
@@ -83,20 +83,16 @@
 		int str2len = str2.length();
 
 		if (str2len == 0) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		int index = str1.indexOf(str2);
 		if (index == -1) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		
-		rs.add(new XSString(str1.substring(0, index)));
-
-		return rs;
+		return new XSString(str1.substring(0, index));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSum.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSum.java
index d992386..2df15b0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSum.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnSum.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,21 +9,28 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
  *     Jesper Moller - bug 281028 - fix promotion rules for fn:sum
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.ScalarTypePromoter;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.TypePromoter;
 
-import java.math.BigInteger;
-import java.util.*;
-
 /**
  * Returns a value obtained by adding together the values in $arg. If the
  * single-argument form of the function is used, then the value returned for an
@@ -51,8 +58,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		Iterator argIterator = args.iterator();
 		ResultSequence argSequence = (ResultSequence)argIterator.next();
 		AnyAtomicType zero = ZERO;
@@ -61,7 +67,7 @@
 			if (zeroSequence.size() != 1)
 				throw new DynamicError(TypeError.invalid_type(null));
 			if (! (zeroSequence.first() instanceof AnyAtomicType))
-				throw new DynamicError(TypeError.invalid_type(zeroSequence.first().string_value()));
+				throw new DynamicError(TypeError.invalid_type(zeroSequence.first().getStringValue()));
 			zero = (AnyAtomicType)zeroSequence.first();
 		}
 		return sum(argSequence, zero);
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDate.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDate.java
index ba1b926..f389657 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDate.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
 
 /**
  * Returns the timezone component of $arg if any. If $arg has a timezone
@@ -45,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return timezone_from_date(args);
 	}
 
@@ -65,19 +67,16 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDate dt = (XSDate) arg1.first();
 
 		if (dt.timezoned()) {
-			rs.add(dt.tz());
+			return dt.tz();
 		}
-
-		return rs;
+		return ResultBuffer.EMPTY;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDateTime.java
index 221bc8e..86328f4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
 
 /**
  * Returns the timezone component of $arg if any. If $arg has a timezone
@@ -45,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return timezone_from_date_time(args);
 	}
 
@@ -65,19 +67,17 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDateTime dt = (XSDateTime) arg1.first();
 
 		if (dt.timezoned()) {
-			rs.add(dt.tz());
+			return dt.tz();
 		}
 
-		return rs;
+		return ResultBuffer.EMPTY;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromTime.java
index b415371..c4f0cbc 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTimezoneFromTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
 
 /**
  * Returns the timezone component of $arg if any. If $arg has a timezone
@@ -45,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return timezone_from_time(args);
 	}
 
@@ -65,19 +67,16 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSTime dt = (XSTime) arg1.first();
 
 		if (dt.timezoned()) {
-			rs.add(dt.tz());
+			return dt.tz();
 		}
-
-		return rs;
+		return ResultBuffer.EMPTY;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTokenize.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTokenize.java
index 0462216..73ad2db 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTokenize.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTokenize.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,18 +9,23 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 282096 - clean up string storage
  *     Jesper S Moller      - Bug 281938 - no matches should return full input 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.regex.Matcher;
+import java.util.regex.PatternSyntaxException;
 
-import java.util.*;
-import java.util.regex.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * This function breaks the $input string into a sequence of strings, treating
@@ -46,8 +51,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return tokenize(args);
 	}
 
@@ -63,7 +67,7 @@
 	public static ResultSequence tokenize(Collection args) throws DynamicError {
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// get args
 		Iterator argiter = cargs.iterator();
@@ -80,28 +84,29 @@
 		if (argiter.hasNext()) {
 			ResultSequence flagRS = null;
 			flagRS = (ResultSequence) argiter.next();
-			flags = flagRS.first().string_value();
+			flags = flagRS.first().getStringValue();
 			if (validflags.indexOf(flags) == -1 && flags.length() > 0 ) {
 				throw DynamicError.regex_flags_error(null);
 			}
 		}
 
 		try {
-			ArrayList<String> ret = tokenize(pattern, flags, str1);
+			ArrayList ret = tokenize(pattern, flags, str1);
 
-			for(String token : ret) {
-				rs.add(new XSString(token));
+			for (Iterator retIter = ret.iterator(); retIter.hasNext();) {
+			   rs.add(new XSString((String)retIter.next()));	
 			}
+			
 		} catch (PatternSyntaxException err) {
 			throw DynamicError.regex_error(null);
 		}
 
-		return rs;
+		return rs.getSequence();
 	}
 	
-	private static ArrayList<String> tokenize(String pattern, String flags, String src) throws DynamicError {
+	private static ArrayList tokenize(String pattern, String flags, String src) throws DynamicError {
 		Matcher matcher = regex(pattern, flags, src);
-		ArrayList<String> tokens = new ArrayList<String>();
+		ArrayList tokens = new ArrayList();
 		int startpos = 0;
 		int endpos = src.length();
 		while (matcher.find()) {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrace.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrace.java
index ed920f7..e184f82 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrace.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,15 +7,20 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * The input $value is returned, unchanged, as the result of the function. In
@@ -41,8 +46,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return trace(args);
 	}
 
@@ -69,7 +73,7 @@
 		if (arg2.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg2.first();
+		Item at = arg2.first();
 		if (!(at instanceof XSString))
 			DynamicError.throw_type_error();
 
@@ -81,7 +85,7 @@
 			at = (AnyType) i.next();
 
 			System.out.println(label.value() + " [" + index + "] "
-					+ at.string_type() + ":" + at.string_value());
+					+ ((AnyType)at).string_type() + ":" + at.getStringValue());
 
 		}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTranslate.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTranslate.java
index 3af784b..140ffcb 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTranslate.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTranslate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,19 +9,26 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 282096 - clean up string storage and make
  *                                         translate function surrogate aware
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.CodePointIterator;
 import org.eclipse.wst.xml.xpath2.processor.internal.utils.StringCodePointIterator;
 
-import java.util.*;
+import com.ibm.icu.lang.UCharacter;
 
 /**
  * <p>
@@ -82,8 +89,7 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the arguments being translated.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return translate(args);
 	}
 
@@ -104,36 +110,31 @@
 		ResultSequence arg2 = (ResultSequence) argi.next();
 		ResultSequence arg3 = (ResultSequence) argi.next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		String str = ((XSString) arg1.first()).value();
 		String mapstr = ((XSString) arg2.first()).value();
 		String transstr = ((XSString) arg3.first()).value();
 
-		Map<Integer, Integer> replacements = buildReplacementMap(mapstr, transstr);
+		Map replacements = buildReplacementMap(mapstr, transstr);
 		
 		StringBuffer sb = new StringBuffer(str.length());
 		CodePointIterator strIter = new StringCodePointIterator(str);
 		for (int input = strIter.current(); input != CodePointIterator.DONE; input = strIter.next()) {
-			Integer inputCodepoint = Integer.valueOf(input);
+			Integer inputCodepoint = new Integer(input);
 			if (replacements.containsKey(inputCodepoint)) {
-				Integer replaceWith = replacements.get(inputCodepoint);
+				Integer replaceWith = (Integer)replacements.get(inputCodepoint);
 				if (replaceWith != null) {
-					sb.appendCodePoint(replaceWith.intValue());
+					sb.append(UCharacter.toChars(replaceWith.intValue()));
 				}					
 			} else {
-				sb.appendCodePoint(input);
+				sb.append(UCharacter.toChars(input));
 			}
 		}
 		
-		rs.add(new XSString(sb.toString()));
-
-		return rs;
+		return new XSString(sb.toString());
 	}
 
 	/**
@@ -144,9 +145,9 @@
 	 * @param transstr The "mapping into" string
 	 * @return A map which maps input codepoint to output codepoint (or null)
 	 */
-	private static Map<Integer, Integer> buildReplacementMap(String mapstr, String transstr) {
+	private static Map buildReplacementMap(String mapstr, String transstr) {
 		// Build mapping (map from codepoint -> codepoint)		
-		Map<Integer, Integer> replacements = new HashMap<Integer, Integer>(mapstr.length() * 4);
+		Map replacements = new HashMap(mapstr.length() * 4);
 
 		CodePointIterator mapIter = new StringCodePointIterator(mapstr);
 		CodePointIterator transIter = new StringCodePointIterator(transstr);
@@ -154,10 +155,10 @@
 		int mapFrom = mapIter.current();
 		int mapTo = transIter.current();
 		while (mapFrom != CodePointIterator.DONE) {
-			Integer codepointFrom = Integer.valueOf(mapFrom);
+			Integer codepointFrom = new Integer(mapFrom);
 			if (! replacements.containsKey(codepointFrom)) {
 				// only overwrite if it doesn't exist already
-				Integer replacement = mapTo != CodePointIterator.DONE ? Integer.valueOf(mapTo) : null;
+				Integer replacement = mapTo != CodePointIterator.DONE ? new Integer(mapTo) : null;
 				replacements.put(codepointFrom, replacement);
 			}
 			mapFrom = mapIter.next();
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrue.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrue.java
index af464a7..358b54a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrue.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnTrue.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,16 +7,17 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 
 /**
  * Returns the xs:boolean value true. Equivalent to xs:boolean("1").
@@ -38,8 +39,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return fn_true(args);
 	}
 
@@ -55,10 +55,6 @@
 	public static ResultSequence fn_true(Collection args) throws DynamicError {
 		assert args.size() == 0;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(new XSBoolean(true));
-
-		return rs;
+		return XSBoolean.TRUE;
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUnordered.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUnordered.java
index 3f58acb..4b1e637 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUnordered.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUnordered.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,16 +7,21 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns the items of $sourceSeq in a non-deterministic order.
@@ -38,8 +43,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return unordered(args);
 	}
 
@@ -56,14 +60,12 @@
 
 		assert args.size() == 1;
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// get args
 		Iterator citer = args.iterator();
 		ResultSequence arg = (ResultSequence) citer.next();
 
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// XXX lame
 		ArrayList tmp = new ArrayList();
@@ -72,9 +74,10 @@
 
 		Collections.shuffle(tmp);
 
+		ResultBuffer rb = new ResultBuffer();
 		for (Iterator i = tmp.iterator(); i.hasNext();)
-			rs.add((AnyType) i.next());
+			rb.add((AnyType) i.next());
 
-		return rs;
+		return rb.getSequence();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUpperCase.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUpperCase.java
index b2fd656..9c148a4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUpperCase.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnUpperCase.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,17 +7,19 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
 
 /**
  * <p>
@@ -58,8 +60,7 @@
 	 *             Dynamic error.
 	 * @return The evaluation of the arguments being converted to upper case.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return upper_case(args);
 	}
 
@@ -78,18 +79,13 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			rs.add(new XSString(""));
-			return rs;
+			return new XSString("");
 		}
 
 		String str = ((XSString) arg1.first()).value();
 
-		rs.add(new XSString(str.toUpperCase()));
-
-		return rs;
+		return new XSString(str.toUpperCase());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDate.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDate.java
index d8b67cf..03eaf79 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDate.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,22 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer representing the year in the localized value of $arg.
@@ -45,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return year_from_date(args);
 	}
 
@@ -65,19 +68,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDate dt = (XSDate) arg1.first();
 
 		int res = dt.year();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDateTime.java
index a87b015..a14b35c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearFromDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,22 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer representing the year component in the localized value
@@ -45,8 +49,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return year_from_date_time(args);
 	}
 
@@ -65,19 +68,15 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDateTime dt = (XSDateTime) arg1.first();
 
 		int res = dt.year();
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearsFromDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearsFromDuration.java
index a40dfa8..2bdc76f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearsFromDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnYearsFromDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,18 +11,22 @@
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type
  *     David Carver - bug 282223 - implementation of xs:duration.
  *     David Carver (STAR) - bug 262765 - fixed expected xs:duration argument 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Returns an xs:integer representing the years component in the canonical
@@ -48,8 +52,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return years_from_duration(args);
 	}
 
@@ -68,10 +71,8 @@
 
 		ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
 
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg1.empty()) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 
 		XSDuration ymd = (XSDuration) arg1.first();
@@ -80,9 +81,7 @@
 		if (ymd.negative())
 			res *= -1;
 
-		rs.add(new XSInteger(BigInteger.valueOf(res)));
-
-		return rs;
+		return new XSInteger(BigInteger.valueOf(res));
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnZeroOrOne.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnZeroOrOne.java
index 7a1108e..4ad0316 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnZeroOrOne.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FnZeroOrOne.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,15 +7,17 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Returns $arg if it contains zero or one items. Otherwise, raises an error
@@ -38,8 +40,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return zero_or_one(args);
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsConvertOperand.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsConvertOperand.java
index 69610a3..cecf461 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsConvertOperand.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsConvertOperand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,16 +7,26 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic;
 
 /**
  * Function to convert a sequence of items to a sequence of atomic values.
@@ -36,8 +46,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		return convert_operand(args);
 	}
 
@@ -63,18 +72,18 @@
 		if (expected.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = expected.first();
+		Item at = expected.first();
 
 		if (!(at instanceof AnyAtomicType))
 			DynamicError.throw_type_error();
 
 		AnyAtomicType exp_aat = (AnyAtomicType) at;
 
-		ResultSequence result = ResultSequenceFactory.create_new();
+		ResultBuffer result = new ResultBuffer();
 
 		// 1
 		if (actual.empty())
-			return result;
+			return result.getSequence();
 
 		// convert sequence
 		for (Iterator i = actual.iterator(); i.hasNext();) {
@@ -84,23 +93,15 @@
 			if (item instanceof XSUntypedAtomic) {
 				// a
 				if (exp_aat instanceof XSUntypedAtomic)
-					result.add(new XSString(item.string_value()));
+					result.add(new XSString(item.getStringValue()));
 				// b
 				else if (exp_aat instanceof NumericType)
-					result.add(new XSDouble(item.string_value()));
+					result.add(new XSDouble(item.getStringValue()));
 				// c
 				else {
 					assert exp_aat instanceof CtrType;
-
 					CtrType cons = (CtrType) exp_aat;
-
-					ResultSequence tmp = ResultSequenceFactory
-							.create_new(new XSString(item.string_value()));
-
-					ResultSequence converted = cons.constructor(tmp);
-					result.concat(converted);
-
-					tmp.release();
+					result.concat(cons.constructor(new XSString(item.getStringValue())));
 				}
 			}
 			// 4
@@ -109,6 +110,6 @@
 
 		}
 
-		return result;
+		return result.getSequence();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsDiv.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsDiv.java
index 34e69ca..0208a23 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsDiv.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsDiv.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,15 +8,17 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for the Division function.
@@ -38,8 +40,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return fs_div(args);
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsEq.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsEq.java
index d47199c..2b35be7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsEq.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsEq.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,19 +13,32 @@
  *     Jesper S Moller - bug 283214 - fix eq for untyped atomic values
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
-import java.lang.reflect.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic;
 
 /**
  * Class for the Equality function.
@@ -47,11 +60,10 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
-		return fs_eq_value(args, dynamic_context());
+		return fs_eq_value(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -80,14 +92,12 @@
 			if (rs.size() > 1)
 				throw new DynamicError(TypeError.invalid_type(null));
 
-			AnyType arg = rs.first();
+			Item arg = rs.first();
 
 			if (arg instanceof XSUntypedAtomic)
-				arg = new XSString(arg.string_value());
+				arg = new XSString(arg.getStringValue());
 
-			rs = ResultSequenceFactory.create_new();
-			rs.add(arg);
-			result.add(rs);
+			result.add(arg);
 		}
 
 		return result;
@@ -102,9 +112,9 @@
 	 *             Dynamic error.
 	 * @return Result of conversion.
 	 */
-	public static ResultSequence fs_eq_value(Collection args, DynamicContext dynamicContext)
+	public static ResultSequence fs_eq_value(Collection args, DynamicContext context)
 			throws DynamicError {
-		return do_cmp_value_op(args, CmpEq.class, "eq", dynamicContext);
+		return do_cmp_value_op(args, CmpEq.class, "eq", context);
 	}
 
 	/**
@@ -118,24 +128,24 @@
 	 *             Dynamic error.
 	 * @return Result of Equality operation.
 	 */
-	public static boolean fs_eq_fast(AnyType one, AnyType two, DynamicContext dynamicContext)
+	public static boolean fs_eq_fast(AnyType one, AnyType two, DynamicContext context)
 			throws DynamicError {
 
-		one = FnData.atomize(one);
-		two = FnData.atomize(two);
+		one = FnData.atomize((Item)one);
+		two = FnData.atomize((Item)two);
 
 		if (one instanceof XSUntypedAtomic)
-			one = new XSString(one.string_value());
+			one = new XSString(one.getStringValue());
 
 		if (two instanceof XSUntypedAtomic)
-			two = new XSString(two.string_value());
+			two = new XSString(two.getStringValue());
 
 		if (!(one instanceof CmpEq))
 			DynamicError.throw_type_error();
 
 		CmpEq cmpone = (CmpEq) one;
 
-		return cmpone.eq(two, dynamicContext);
+		return cmpone.eq(two, context);
 	}
 
 	/**
@@ -152,7 +162,7 @@
 	 * @return Result of Equality operation.
 	 */
 	private static boolean do_general_pair(AnyType a, AnyType b,
-			Method comparator, DynamicContext dc) throws DynamicError {
+			Method comparator, DynamicContext ec) throws DynamicError {
 
 		// section 3.5.2
 
@@ -162,9 +172,9 @@
 		if ((a instanceof XSUntypedAtomic && b instanceof NumericType)
 				|| (b instanceof XSUntypedAtomic && a instanceof NumericType)) {
 			if (a instanceof XSUntypedAtomic)
-				a = new XSDouble(a.string_value());
+				a = new XSDouble(a.getStringValue());
 			else
-				b = new XSDouble(b.string_value());
+				b = new XSDouble(b.getStringValue());
 
 		}
 
@@ -175,9 +185,9 @@
 				&& (b instanceof XSString || b instanceof XSUntypedAtomic) || (b instanceof XSUntypedAtomic && (a instanceof XSString || a instanceof XSUntypedAtomic)))) {
 
 			if (a instanceof XSUntypedAtomic)
-				a = new XSString(a.string_value());
+				a = new XSString(a.getStringValue());
 			if (b instanceof XSUntypedAtomic)
-				b = new XSString(b.string_value());
+				b = new XSString(b.getStringValue());
 		}
 
 		// rule c
@@ -185,14 +195,15 @@
 		// cast untyped to dynamic type of other
 
 		// XXX?
+		// TODO: This makes no sense as implemented before
 		else if (a instanceof XSUntypedAtomic) {
-			ResultSequence converted = ResultSequenceFactory.create_new(a);
-			assert converted.size() == 1;
-			a = converted.first();
+//			ResultSequence converted = ResultSequenceFactory.create_new(a);
+//			assert converted.size() == 1;
+//			a = converted.first();
 		} else if (b instanceof XSUntypedAtomic) {
-			ResultSequence converted = ResultSequenceFactory.create_new(b);
-			assert converted.size() == 1;
-			b = converted.first();
+//			ResultSequence converted = ResultSequenceFactory.create_new(b);
+//			assert converted.size() == 1;
+//			b = converted.first();
 		}
 
 		// rule d
@@ -205,7 +216,7 @@
 		args.add(one);
 		args.add(two);
 
-		Object margs[] = { args, dc };
+		Object margs[] = { args, ec };
 
 		ResultSequence result = null;
 		try {
@@ -215,11 +226,9 @@
 		} catch (InvocationTargetException err) {
 			Throwable ex = err.getTargetException();
 
-			if (ex instanceof DynamicError)
-				throw (DynamicError) ex;
-
-			ex.printStackTrace();
-			System.exit(1);
+			if (ex instanceof RuntimeException)
+				throw (RuntimeException) ex;
+			throw new RuntimeException(ex);
 		}
 
 		if (((XSBoolean) result.first()).value())
@@ -235,12 +244,10 @@
 	 *            input arguments.
 	 * @param dc
 	 *         Dynamic context 
-	 * @throws DynamicError
-	 *             Dynamic error.
 	 * @return Result of general equality operation.
 	 */
 	public static ResultSequence fs_eq_general(Collection args, DynamicContext dc)
-			throws DynamicError {
+			{
 		return do_cmp_general_op(args, FsEq.class, "fs_eq_value", dc);
 	}
 
@@ -279,8 +286,8 @@
 
 		Iterator argiter = args.iterator();
 
-		ResultSequence one = (ResultSequence) argiter.next();
-		ResultSequence two = (ResultSequence) argiter.next();
+		org.eclipse.wst.xml.xpath2.api.ResultSequence one = (org.eclipse.wst.xml.xpath2.api.ResultSequence) argiter.next();
+		org.eclipse.wst.xml.xpath2.api.ResultSequence two = (org.eclipse.wst.xml.xpath2.api.ResultSequence) argiter.next();
 
 		// XXX ?
 		if (one.empty() || two.empty())
@@ -322,7 +329,7 @@
 	 * @return Result of the operation.
 	 */
 	public static ResultSequence do_cmp_value_op(Collection args, Class type,
-			String mname, DynamicContext dynamicContext) throws DynamicError {
+			String mname, DynamicContext context) throws DynamicError {
 
 		// sanity check args + convert em
 		if (args.size() != 2)
@@ -330,14 +337,12 @@
 
 		Collection cargs = value_convert_args(args);
 
-		ResultSequence result = ResultSequenceFactory.create_new();
-
 		if (cargs.size() == 0)
-			return result;
+			return ResultBuffer.EMPTY;
 
 		// make sure arugments are comparable by equality
 		Iterator argi = cargs.iterator();
-		AnyType arg = ((ResultSequence) argi.next()).first();
+		Item arg = ((ResultSequence) argi.next()).first();
 		ResultSequence arg2 = (ResultSequence) argi.next();
 
 		if (arg2.size() != 1)
@@ -352,7 +357,7 @@
 
 			method = type.getMethod(mname, margsdef);
 
-			Object margs[] = { arg2.first(), dynamicContext };
+			Object margs[] = { arg2.first(), context };
 			Boolean cmpres = (Boolean) method.invoke(arg, margs);
 
 			return ResultSequenceFactory.create_new(new XSBoolean(cmpres
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGe.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGe.java
index 851e4e3..5495ca1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGe.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGe.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Mooller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 
 /**
  * Class for the Greater than or equal to function.
@@ -41,11 +44,10 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
-		return fs_ge_value(args, dynamic_context());
+		return fs_ge_value(args, ec.getDynamicContext());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGt.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGt.java
index a183727..93f34cc 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGt.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsGt.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,16 +9,18 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for the Greater than function.
@@ -40,11 +42,10 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
-		return fs_gt_value(args, dynamic_context());
+		return fs_gt_value(args, ec.getDynamicContext());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsIDiv.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsIDiv.java
index 6111dc3..083486f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsIDiv.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsIDiv.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,15 +8,16 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for Interger division function.
@@ -38,8 +39,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return fs_idiv(args);
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLe.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLe.java
index e1ab4c2..ac7eff4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLe.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLe.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Moller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
 
 /**
  * Class for Less than or equal to function.
@@ -41,11 +44,10 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
-		return fs_le_value(args, dynamic_context());
+		return fs_le_value(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -85,8 +87,7 @@
 	 *             Dynamic error.
 	 * @return Result of the operation.
 	 */
-	public static ResultSequence fs_le_general(Collection args, DynamicContext dc)
-			throws DynamicError {
+	public static ResultSequence fs_le_general(Collection args, DynamicContext dc) {
 		return FsEq.do_cmp_general_op(args, FsLe.class, "fs_le_value", dc);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLt.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLt.java
index 50482e1..635d343 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLt.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsLt.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,16 +9,18 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Moller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for Less than function.
@@ -36,15 +38,12 @@
 	 * 
 	 * @param args
 	 *            argument expressions.
-	 * @throws DynamicError
-	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
-		return fs_lt_value(args, dynamic_context());
+		return fs_lt_value(args, ec.getDynamicContext());
 	}
 
 	/**
@@ -58,9 +57,8 @@
 	 *             Dynamic error.
 	 * @return Result of the operation.
 	 */
-	public static ResultSequence fs_lt_value(Collection args, DynamicContext context)
-			throws DynamicError {
-		return FsEq.do_cmp_value_op(args, CmpLt.class, "lt", context);
+	public static ResultSequence fs_lt_value(Collection args, DynamicContext dc) {
+		return FsEq.do_cmp_value_op(args, CmpLt.class, "lt", dc);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMinus.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMinus.java
index e6309b7..329a735 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMinus.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMinus.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,15 +8,19 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for Minus function.
@@ -38,8 +42,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return fs_minus(args);
@@ -72,12 +75,12 @@
 		// make sure we got only one arg
 		if (args.size() != 1)
 			DynamicError.throw_type_error();
-		ResultSequence arg = (ResultSequence) args.iterator().next();
+		ResultSequence arg = (org.eclipse.wst.xml.xpath2.api.ResultSequence) args.iterator().next();
 
 		// make sure we got only one numeric atom
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
-		AnyType at = arg.first();
+		Item at = arg.first();
 		if (!(at instanceof NumericType))
 			DynamicError.throw_type_error();
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMod.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMod.java
index 1fc361d..d2c0314 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMod.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsMod.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,15 +8,16 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for Modular function.
@@ -38,8 +39,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return fs_mod(args);
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsNe.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsNe.java
index 521837c..49dd543 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsNe.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsNe.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,16 +9,17 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Moller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for Not equal function.
@@ -40,11 +41,10 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, DynamicContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
-		return fs_ne_value(args, dynamic_context());
+		return fs_ne_value(args, ec);
 	}
 
 	/**
@@ -74,9 +74,9 @@
 	 *             Dynamic error.
 	 * @return Result of the operation.
 	 */
-	public static ResultSequence fs_ne_general(Collection args, DynamicContext dc)
+	public static ResultSequence fs_ne_general(Collection args, DynamicContext ec)
 			throws DynamicError {
-		return FsEq.do_cmp_general_op(args, FsNe.class, "fs_ne_value", dc);
+		return FsEq.do_cmp_general_op(args, FsNe.class, "fs_ne_value", ec);
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsPlus.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsPlus.java
index 61d14bd..441f904 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsPlus.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsPlus.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,19 +9,30 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moller  - Bug 286062 - Add type promotion for numeric operators  
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
-import java.lang.reflect.*;
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.TypeError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic;
 
 /**
  * Class for Plus function.
@@ -43,8 +54,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, EvaluationContext ec) {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return fs_plus(args);
@@ -69,7 +79,7 @@
 		
 		// atomize arguments
 		for (Iterator i = args.iterator(); i.hasNext();) {
-			ResultSequence rs = FnData.atomize((ResultSequence) i.next());
+			org.eclipse.wst.xml.xpath2.api.ResultSequence rs = FnData.atomize((org.eclipse.wst.xml.xpath2.api.ResultSequence) i.next());
 
 			if (rs.empty())
 				return new ArrayList();
@@ -77,27 +87,27 @@
 			if (rs.size() > 1)
 				throw new DynamicError(TypeError.invalid_type(null));
 
-			AnyType arg = rs.first();
+			AnyType arg = (AnyType) rs.item(0);
 
 			if (arg instanceof XSUntypedAtomic) {
-				arg = new XSDouble(arg.string_value());
+				arg = new XSDouble(arg.getStringValue());
 			}
 
-			rs = ResultSequenceFactory.create_new();
-			rs.add(arg);
 			if (arg instanceof XSDouble) has_double = true;
 			if (arg instanceof XSFloat) has_float = true;
-			result.add(rs);
+			result.add(ResultBuffer.wrap(arg));
 		}
 
 		if (has_double) has_float = false;
 		
 		if (has_double || has_float) {
+			Collection result2 = new ArrayList();
+
 			// promote arguments
 			for (Iterator i = result.iterator(); i.hasNext();) {
-				ResultSequence rs = (ResultSequence) i.next();
+				org.eclipse.wst.xml.xpath2.api.ResultSequence rs = (org.eclipse.wst.xml.xpath2.api.ResultSequence) i.next();
 								
-				AnyType arg = rs.first();
+				Item arg = rs.item(0);
 				
 				if (has_double && (arg instanceof XSFloat)) {
 					arg = new XSDouble(((XSFloat)arg).float_value());
@@ -106,14 +116,9 @@
 				} else if (has_float && (arg instanceof XSDecimal)) {
 					arg = new XSFloat(((XSDecimal)arg).getValue().floatValue());
 				}
-
-				if (rs.first() != arg) {
-					// Replace arg
-					rs.clear();
-					rs.add(arg);
-				}
+				result2.add(arg);
 			}
-			
+			return result2;
 		}
 		
 		return result;
@@ -154,7 +159,7 @@
 		// make sure we got only one numeric atom
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
-		AnyType at = arg.first();
+		Item at = arg.first();
 		if (!(at instanceof NumericType))
 			DynamicError.throw_type_error();
 
@@ -186,15 +191,13 @@
 
 		Collection cargs = convert_args(args);
 
-		ResultSequence result = ResultSequenceFactory.create_new();
-
 		if (cargs.size() == 0)
-			return result;
+			return ResultBuffer.EMPTY;
 
 		// make sure arugments are good [at least the first one]
 		Iterator argi = cargs.iterator();
-		AnyType arg = ((ResultSequence) argi.next()).first();
-		ResultSequence arg2 = (ResultSequence) argi.next();
+		Item arg = ((org.eclipse.wst.xml.xpath2.api.ResultSequence) argi.next()).item(0);
+		org.eclipse.wst.xml.xpath2.api.ResultSequence arg2 = (org.eclipse.wst.xml.xpath2.api.ResultSequence) argi.next();
 
 		if (!(type.isInstance(arg)))
 			DynamicError.throw_type_error();
@@ -217,13 +220,10 @@
 			assert false;
 		} catch (InvocationTargetException err) {
 			Throwable ex = err.getTargetException();
-
 			if (ex instanceof DynamicError) {
 				throw (DynamicError) ex;
-			}
-			else {
-				ex.printStackTrace();
-				System.exit(1);
+			} else {
+				throw new RuntimeException(ex);
 			}
 		}
 		return null; // unreach!
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsTimes.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsTimes.java
index 322eed9..4fc1f5c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsTimes.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FsTimes.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,15 +8,16 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.Collection;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Class for Multiplication function.
@@ -38,8 +39,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return fs_times(args);
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Function.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Function.java
index 32fb141..8ce5010 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Function.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/Function.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,24 +13,50 @@
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
  *     Jesper Steen Moeller - bug 281159 - implement xs:anyUri -> xs:string promotion
  *     Jesper Steen Moller  - bug 281938 - undefined context should raise error
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+
+import org.eclipse.wst.xml.xpath2.api.EvaluationContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.StaticContext;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * Support for functions.
  */
-public abstract class Function {
+public abstract class Function implements org.eclipse.wst.xml.xpath2.api.Function {
+
+	protected static DatatypeFactory _datatypeFactory;
+	static {
+		try {
+			_datatypeFactory = DatatypeFactory.newInstance();
+		}
+		catch (DatatypeConfigurationException e) {
+			throw new RuntimeException("Cannot initialize XML datatypes", e);
+		}
+	}
 
 	protected QName _name;
 	/**
@@ -42,8 +68,6 @@
 	 * If "at least", this speci, unlimited if -1
 	 */
 	protected int _max_arity;
-	
-	protected FunctionLibrary _fl;
 
 	/**
 	 * Constructor for Function.
@@ -60,7 +84,6 @@
 		}
 		_min_arity = arity;
 		_max_arity = arity;
-		_fl = null;
 	}
 
 	/**
@@ -78,7 +101,6 @@
 		}
 		_min_arity = min_arity;
 		_max_arity = max_arity;
-		_fl = null;
 	}
 
 	/**
@@ -173,8 +195,10 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	public abstract ResultSequence evaluate(Collection args)
-			throws DynamicError;
+	public org.eclipse.wst.xml.xpath2.processor.ResultSequence evaluate(Collection args)
+			throws DynamicError {
+		throw new UnsupportedOperationException();
+	}
 
 	// convert argument according to section 3.1.5 of xpath 2.0 spec
 	/**
@@ -188,9 +212,9 @@
 	 *             Dynamic error.
 	 * @return Converted argument.
 	 */
-	public static ResultSequence convert_argument(ResultSequence arg,
+	public static org.eclipse.wst.xml.xpath2.api.ResultSequence convert_argument(org.eclipse.wst.xml.xpath2.api.ResultSequence arg,
 			SeqType expected) throws DynamicError {
-		ResultSequence result = arg;
+		ResultBuffer result = new ResultBuffer();
 
 		// XXX: Should use type_class instead and use item.getClass().isAssignableTo(expected.type_class())
 		AnyType expected_type = expected.type();
@@ -200,10 +224,9 @@
 			AnyAtomicType expected_aat = (AnyAtomicType) expected_type;
 			
 			// atomize
-			ResultSequence rs = FnData.atomize(arg);
+			org.eclipse.wst.xml.xpath2.api.ResultSequence rs = FnData.atomize(arg);
 
 			// cast untyped to expected type
-			result = ResultSequenceFactory.create_new();
 			for (Iterator i = rs.iterator(); i.hasNext();) {
 				AnyType item = (AnyType) i.next();
 				
@@ -213,7 +236,7 @@
 					// value of the item
 					ResultSequence converted = null;
 					if (expected_aat instanceof XSString) {
-					   XSString strType = new XSString(item.string_value());
+					   XSString strType = new XSString(item.getStringValue());
 					   converted = ResultSequenceFactory.create_new(strType);
 					}
 					else {
@@ -224,12 +247,12 @@
 				}
 				// xs:anyURI promotion to xs:string
 				else if (item instanceof XSAnyURI && expected_aat instanceof XSString) {
-					result.add(new XSString(item.string_value()));
+					result.add(new XSString(item.getStringValue()));
 				}
 				// numeric type promotion
 				else if (item instanceof NumericType) {
 					if (expected_aat instanceof XSDouble) {
-					  XSDouble doubleType = new XSDouble(item.string_value());
+					  XSDouble doubleType = new XSDouble(item.getStringValue());
 					  result.add(doubleType);
 					}
 					else {
@@ -239,10 +262,12 @@
 					result.add(item);
 				}
 			}
+			// do sequence type matching on converted arguments
+			return expected.match(result.getSequence());
+		} else {
+			// do sequence type matching on converted arguments
+			return expected.match(arg);
 		}
-
-		// do sequence type matching on converted arguments
-		return expected.match(result);
 	}
 
 	// convert arguments
@@ -269,54 +294,74 @@
 
 		// convert all arguments
 		while (argi.hasNext()) {
-			result.add(convert_argument((ResultSequence) argi.next(),
+			result.add(convert_argument((org.eclipse.wst.xml.xpath2.api.ResultSequence) argi.next(),
 					(SeqType) expi.next()));
 		}
 
 		return result;
 	}
 
-	protected static ResultSequence getResultSetForArityZero(DynamicContext d_context)
+	protected static ResultSequence getResultSetForArityZero(EvaluationContext ec)
 			throws DynamicError {
 		ResultSequence rs = ResultSequenceFactory.create_new();
 		
-		AnyType contextItem = d_context.context_item();
+		Item contextItem = ec.getContextItem();
 		if (contextItem != null) {
 		  // if context item is defined, then that is the default argument
 		  // to fn:string function
-		  rs.add(new XSString(contextItem.string_value()));
+		  rs.add(new XSString(contextItem.getStringValue()));
 		} else {
 			throw DynamicError.contextUndefined();
 		}
 		return rs;
 	}
 
-	/**
-	 * Set the function library variable.
-	 * 
-	 * @param fl
-	 *            Function Library.
-	 */
-	public void set_function_library(FunctionLibrary fl) {
-		_fl = fl;
-	}
-
-	protected StaticContext static_context() {
-		if (_fl == null)
-			return null;
-
-		return _fl.static_context();
-	}
-
-	protected DynamicContext dynamic_context() {
-		if (_fl == null)
-			return null;
-
-		return _fl.dynamic_context();
-	}
-
 	public boolean is_vararg() {
 		return _min_arity != _max_arity;
 	}
 
+	public String getName() {
+		return name().local();
+	}
+
+	public int getMinArity() {
+		return min_arity();
+	}
+
+	public int getMaxArity() {
+		return max_arity();
+	}
+
+	public boolean isVariableArgument() {
+		return this.is_vararg();
+	}
+
+	public boolean canMatchArity(int actualArity) {
+		return matches_arity(actualArity);
+	}
+
+	public TypeDefinition getResultType() {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+	}
+
+	public TypeDefinition getArgumentType(int index) {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+	}
+
+	public String getArgumentNameHint(int index) {
+		return "argument_"  + index;
+	}
+
+	public TypeDefinition computeReturnType(Collection args,
+			org.eclipse.wst.xml.xpath2.api.StaticContext sc) {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+	}
+
+	public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(Collection/*<ResultSequence>*/ args,
+			EvaluationContext evaluationContext) {
+		
+		org.eclipse.wst.xml.xpath2.processor.ResultSequence result = evaluate(args);
+		return result;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FunctionLibrary.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FunctionLibrary.java
index 625e123..1de2669 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FunctionLibrary.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FunctionLibrary.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Mukul Gandhi - bug 274471 - improvements to fn:string function (support for arity 0)
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
@@ -23,7 +24,7 @@
 /**
  * Class for Function Library support.
  */
-public class FunctionLibrary {
+public class FunctionLibrary implements org.eclipse.wst.xml.xpath2.api.FunctionLibrary {
 	private String _namespace;
 	private Map _functions;
 	private StaticContext _sc;
@@ -50,7 +51,6 @@
 	 */
 	public void add_function(Function x) {
 		x.name().set_namespace(_namespace);
-		x.set_function_library(this);
 		_functions.put(x.signature(), x);
 	}
 
@@ -135,4 +135,18 @@
 	public DynamicContext dynamic_context() {
 		return _dc;
 	}
+
+	public boolean functionExists(String name, int arity) {
+		return function_exists(new QName(null,name, namespace()), arity);
+	}
+
+	public org.eclipse.wst.xml.xpath2.api.Function resolveFunction(
+			String localName, int arity) {
+
+		return function(new QName("f", localName, namespace()), arity);
+	}
+
+	public String getNamespace() {
+		return namespace();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FunctionLibraryImpl.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FunctionLibraryImpl.java
new file mode 100644
index 0000000..f2b7440
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/FunctionLibraryImpl.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Mukul Gandhi - bug 274471 - improvements to fn:string function (support for arity 0)
+ *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.processor.internal.function;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.wst.xml.xpath2.api.Function;
+import org.eclipse.wst.xml.xpath2.api.FunctionLibrary;
+
+/**
+ * Class for Function Library support.
+ */
+public class FunctionLibraryImpl implements FunctionLibrary {
+	private String _namespace;
+	private Map _functions;
+
+	/**
+	 * Constructor for FunctionLibrary.
+	 * 
+	 * @param ns
+	 *            namespace.
+	 */
+	public FunctionLibraryImpl(String ns) {
+		_namespace = ns;
+		_functions = new HashMap();
+	}
+
+	/**
+	 * Add a function.
+	 * 
+	 * @param x
+	 *            function to add.
+	 */
+	public void addFunction(Function x) {
+		_functions.put(signature(x), x);
+	}
+
+	/**
+	 * Obtain the function name and arity from signature.
+	 * 
+	 * @param f
+	 *            current function.
+	 * @return Signature.
+	 */
+	private static String signature(Function f) {
+		return signature(f.getName(), f.isVariableArgument() ? -1 : f.getMinArity());
+	}
+
+	/**
+	 * Apply the name and arity to signature.
+	 * 
+	 * @param name
+	 *            QName.
+	 * @param arity
+	 *            arity of the function.
+	 * @return Signature.
+	 */
+	private static String signature(String name, int arity) {
+		return name + "_" + ((arity < 0) ? "x" : arity);
+	}
+
+	public boolean functionExists(String name, int arity) {
+		return resolveFunction(name, arity) != null;
+	}
+
+	public org.eclipse.wst.xml.xpath2.api.Function resolveFunction(
+			String localName, int arity) {
+
+		Function f = (Function) _functions.get(signature(localName, arity));
+
+		if (f != null || arity == -1)
+			return f;
+
+		// see if we got a varg one
+		f = (Function) _functions.get(signature(localName, -1));
+
+		// nope
+		if (f == null)
+			return null;
+		
+		if (f.canMatchArity(arity))
+			return f;
+
+		return null;
+	}
+
+	public String getNamespace() {
+		return _namespace;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathDiv.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathDiv.java
index 5441f34..5b582fa 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathDiv.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathDiv.java
@@ -11,8 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 
 /**
  * Support for Mathematical division.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathIDiv.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathIDiv.java
index f3d76de..a12f0ff 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathIDiv.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathIDiv.java
@@ -11,8 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 
 /**
  * Support for Mathematical Integer Division.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMinus.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMinus.java
index 7086b3d..f202a80 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMinus.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMinus.java
@@ -11,8 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 
 /**
  * Support for Mathematical Subtraction.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMod.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMod.java
index 7fa1b02..fb45e93 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMod.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathMod.java
@@ -11,8 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 
 /**
  * Support for Mathematical Modular operation.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathPlus.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathPlus.java
index bcc486d..69123cf 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathPlus.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathPlus.java
@@ -11,8 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 
 /**
  * Support for Mathematical Addition.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathTimes.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathTimes.java
index a888205..5f41ad5 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathTimes.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/MathTimes.java
@@ -11,8 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 
 /**
  * Support for Mathematical Multiplication.
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpExcept.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpExcept.java
index f471b2d..7c70390 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpExcept.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpExcept.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,21 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Support for Except operation on node types.
@@ -42,8 +46,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return op_except(args);
@@ -59,7 +62,7 @@
 	 * @return Result of operation.
 	 */
 	public static ResultSequence op_except(Collection args) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// convert arguments
 		Collection cargs = Function.convert_arguments(args, expected_args());
@@ -87,10 +90,9 @@
 			if (!found)
 				rs.add(node);
 		}
-		rs = NodeType.eliminate_dups(rs);
-		rs = NodeType.sort_document_order(rs);
+		rs = NodeType.linarize(rs);
 
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpFunctionLibrary.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpFunctionLibrary.java
index a5e556e..9bf0201 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpFunctionLibrary.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpFunctionLibrary.java
@@ -17,7 +17,7 @@
  * 
  * This is necessary if normalization is being used.
  */
-public class OpFunctionLibrary extends FunctionLibrary {
+public class OpFunctionLibrary extends FunctionLibraryImpl {
 
 	// XXX should be internal
 	public static final String XPATH_OP_NS = "http://www.w3.org/TR/2003/WD-xquery-semantics-20030502/";
@@ -29,26 +29,26 @@
 		super(XPATH_OP_NS);
 
 		// operators according to formal semantics
-		add_function(new FsDiv());
-		add_function(new FsEq());
-		add_function(new FsGe());
-		add_function(new FsGt());
-		add_function(new FsIDiv());
-		add_function(new FsLe());
-		add_function(new FsLt());
-		add_function(new FsMinus());
-		add_function(new FsMod());
-		add_function(new FsNe());
-		add_function(new FsPlus());
-		add_function(new FsTimes());
+		addFunction(new FsDiv());
+		addFunction(new FsEq());
+		addFunction(new FsGe());
+		addFunction(new FsGt());
+		addFunction(new FsIDiv());
+		addFunction(new FsLe());
+		addFunction(new FsLt());
+		addFunction(new FsMinus());
+		addFunction(new FsMod());
+		addFunction(new FsNe());
+		addFunction(new FsPlus());
+		addFunction(new FsTimes());
 
 		// utility functions in formal semantics
-		add_function(new FsConvertOperand());
+		addFunction(new FsConvertOperand());
 
 		// operators according to functions & operators
-		add_function(new OpExcept());
-		add_function(new OpIntersect());
-		add_function(new OpTo());
-		add_function(new OpUnion());
+		addFunction(new OpExcept());
+		addFunction(new OpIntersect());
+		addFunction(new OpTo());
+		addFunction(new OpUnion());
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpIntersect.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpIntersect.java
index e0185c5..3c15b4c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpIntersect.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpIntersect.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,21 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Support for Intersect operation.
@@ -42,8 +46,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return op_intersect(args);
@@ -60,7 +63,7 @@
 	 */
 	public static ResultSequence op_intersect(Collection args)
 			throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// convert arguments
 		Collection cargs = Function.convert_arguments(args, expected_args());
@@ -88,10 +91,9 @@
 			if (found)
 				rs.add(node);
 		}
-		rs = NodeType.eliminate_dups(rs);
-		rs = NodeType.sort_document_order(rs);
+		rs = NodeType.linarize(rs);
 
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpTo.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpTo.java
index 1d94b91..bb2e615 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpTo.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpTo.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,18 +8,23 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Mukul Gandhi - bug 274805 - improvements to xs:integer data type 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
-
 import java.math.BigInteger;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.RangeResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
 
 /**
  * Support for To operation.
@@ -43,8 +48,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() == 2;
 
 		// Iterator i = args.iterator();
@@ -63,8 +67,6 @@
 	 * @return Result of operation.
 	 */
 	public static ResultSequence op_to(Collection args) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// convert arguments
 		Collection cargs = Function.convert_arguments(args, expected_args());
 
@@ -74,18 +76,16 @@
 		int one = ((XSInteger) r.first()).int_value().intValue();
 		r = (ResultSequence) iter.next();
 		if (r.first() == null) {
-			return rs;
+			return ResultBuffer.EMPTY;
 		}
 		int two = ((XSInteger) r.first()).int_value().intValue();
 
 		if (one > two)
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// inclusive first and last
-		rs.add(new XSInteger(BigInteger.valueOf(one)));
-
 		if (one == two) {
-			return rs;
+			return new XSInteger(BigInteger.valueOf(one));
 		}
 		/*
 		 * for(one++; one <= two; one++) { rs.add(new XSInteger(one)); }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpUnion.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpUnion.java
index f76601f..4e63854 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpUnion.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/function/OpUnion.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,21 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Steen Moeller - bug 285145 - implement full arity checking
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.function;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.*;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.SeqType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
 
 /**
  * Support for Union operation.
@@ -42,8 +46,7 @@
 	 *             Dynamic error.
 	 * @return Result of evaluation.
 	 */
-	@Override
-	public ResultSequence evaluate(Collection args) throws DynamicError {
+	public ResultSequence evaluate(Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws DynamicError {
 		assert args.size() >= min_arity() && args.size() <= max_arity();
 
 		return op_union(args);
@@ -59,7 +62,7 @@
 	 * @return Result of operation.
 	 */
 	public static ResultSequence op_union(Collection args) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 
 		// convert arguments
 		Collection cargs = Function.convert_arguments(args, expected_args());
@@ -72,10 +75,9 @@
 		// XXX i don't fink u've ever seen anything lamer than this
 		rs.concat(one);
 		rs.concat(two);
-		rs = NodeType.eliminate_dups(rs);
-		rs = NodeType.sort_document_order(rs);
+		rs = NodeType.linarize(rs);
 
-		return rs;
+		return rs.getSequence();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyAtomicType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyAtomicType.java
index 0b2846b..d3bc049 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyAtomicType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyAtomicType.java
@@ -11,6 +11,7 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+
 /**
  * Common base for every atomic type
  */
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyType.java
index 6724dd3..db31d14 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AnyType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,14 +7,36 @@
  *
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
-
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import java.util.Collections;
+import java.util.Iterator;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence;
+
 /**
  * Common base for every type
  */
-public abstract class AnyType {
+public abstract class AnyType implements SingleItemSequence {
+
+	protected static DatatypeFactory _datatypeFactory;
+	static {
+		try {
+			_datatypeFactory = DatatypeFactory.newInstance();
+		}
+		catch (DatatypeConfigurationException e) {
+			throw new RuntimeException("Cannot initialize XML datatypes", e);
+		}
+	}
+
 	/**
 	 * Retrieves the datatype's full pathname
 	 * 
@@ -23,9 +45,68 @@
 	public abstract String string_type();
 
 	/**
-	 * Retrieves the datatype's name
+	 * Retrieves the datatype's text representation
 	 * 
-	 * @return Datatype's name
+	 * @return Value as a string
 	 */
-	public abstract String string_value();
+	public abstract String getStringValue();
+	
+	public String string_value() {
+		return getStringValue();
+	}
+	
+	/**
+	 * Returns the "new style" of TypeDefinition for this item.
+	 * 
+	 * @return Type definition (possibly backed by a schema type)
+	 */
+	public abstract TypeDefinition getTypeDefinition();
+
+	public boolean empty() {
+		return false;
+	}
+	
+	public Iterator<Item> iterator() {
+		return Collections.singletonList((Item)this).iterator();
+	}
+	
+	public ItemType getItemType() {
+		return new SimpleAtomicItemTypeImpl(getTypeDefinition());
+	}
+	
+	abstract public Object getNativeValue();
+	
+	public int size() {
+		return 1;
+	}
+
+	public Item item(int index) {
+		checkIOOB(index);
+		return this;
+	}
+
+	private void checkIOOB(int index) {
+		if (index != 0) throw new IndexOutOfBoundsException("Index out of bounds, index = " + index + ", length = 1");
+	}
+
+	public Object value(int index) {
+		checkIOOB(index);
+		return getNativeValue();
+	}
+	public ItemType itemType(int index) {
+		checkIOOB(index);
+		return getItemType();
+	}
+	
+	public AnyType first() {
+		return this;
+	}
+
+	public Object firstValue() {
+		return this.getNativeValue();
+	}
+
+	public ItemType sequenceType() {
+		return new SimpleAtomicItemTypeImpl(getTypeDefinition(), ItemType.OCCURRENCE_ONE);
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AttrType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AttrType.java
index 3acf4d9..c2044c0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AttrType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/AttrType.java
@@ -23,10 +23,10 @@
 
 import java.util.List;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 import org.w3c.dom.Attr;
 import org.w3c.dom.TypeInfo;
 
@@ -62,7 +62,6 @@
 	 * 
 	 * @return "attribute" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return ATTRIBUTE;
 	}
@@ -72,8 +71,7 @@
 	 * 
 	 * @return String representation of the attribute being stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value.getValue();
 	}
 
@@ -82,20 +80,16 @@
 	 * 
 	 * @return New ResultSequence consisting of the attribute being stored
 	 */
-	@Override
 	public ResultSequence typed_value() {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		TypeDefinition typeDef = getType();
 
 		if (typeDef != null) {
-			List<Short> types = typeDef.getSimpleTypes(_value);
- 		    rs = getXDMTypedValue(typeDef, types);
+			List/*<Short>*/ types = typeDef.getSimpleTypes(_value);
+ 		    return getXDMTypedValue(typeDef, types);
 		}
 		else {
-		   rs.add(new XSUntypedAtomic(string_value()));  
+		   return new XSUntypedAtomic(getStringValue());  
 		}
-		return rs;
 	}
 
 	/**
@@ -103,7 +97,6 @@
 	 * 
 	 * @return Name of the node
 	 */
-	@Override
 	public QName node_name() {
 		QName name = new QName(_value.getPrefix(), _value.getLocalName(),
 				_value.getNamespaceURI());
@@ -111,7 +104,6 @@
 		return name;
 	}
 
-	@Override
 	/**
 	 * Checks if the current node is of type ID
 	 * @since 1.1;
@@ -124,7 +116,6 @@
 	 * 
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isIDREF() {
 		return isAttrType(SCHEMA_TYPE_IDREF);
 	}
@@ -140,5 +131,8 @@
 		TypeInfo typeInfo = _value.getSchemaTypeInfo();
 		return isType(typeInfo, typeName);
 	}
-	
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNTYPEDATOMIC;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CalendarType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CalendarType.java
index 8b05826..af0518c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CalendarType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CalendarType.java
@@ -14,6 +14,7 @@
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.util.Calendar;
+import java.util.GregorianCalendar;
 
 // common base for anything that uses a calendar... basically stuff doing with
 // time... hopefully in the future this may be factored out here
@@ -22,6 +23,8 @@
  */
 public abstract class CalendarType extends CtrType {
 
+	public abstract Calendar calendar();
+	
 	public Calendar normalizeCalendar(Calendar cal, XSDuration timezone) {
 		Calendar adjusted = (Calendar) cal.clone();
 		
@@ -53,4 +56,8 @@
 		}
 		return false;
 	}
+	
+	public Object getNativeValue() {
+		return _datatypeFactory.newXMLGregorianCalendar((GregorianCalendar)calendar());
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CommentType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CommentType.java
index 3452ac5..85bd1f4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CommentType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CommentType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,14 +9,16 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Jesper Moller - bug 275610 - Avoid big time and memory overhead for externals
  *     David Carver  - bug 281186 - implementation of fn:id and fn:idref
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.w3c.dom.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+import org.w3c.dom.Comment;
 
 /**
  * A representation of the CommentType datatype
@@ -41,7 +43,6 @@
 	 * 
 	 * @return "comment" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return COMMENT;
 	}
@@ -51,8 +52,7 @@
 	 * 
 	 * @return String representation of the comment being stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value.getNodeValue();
 	}
 
@@ -61,13 +61,8 @@
 	 * 
 	 * @return New ResultSequence consisting of the comment stored
 	 */
-	@Override
 	public ResultSequence typed_value() {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(new XSString(_value.getData()));
-
-		return rs;
+		return new XSString(_value.getData());
 	}
 
 	/**
@@ -75,7 +70,6 @@
 	 * 
 	 * @return null
 	 */
-	@Override
 	public QName node_name() {
 		return null;
 	}
@@ -83,7 +77,6 @@
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isID() {
 		return false;
 	}
@@ -91,8 +84,11 @@
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isIDREF() {
 		return false;
 	}
+	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNTYPEDATOMIC;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CtrType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CtrType.java
index 6cae640..753edff 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CtrType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/CtrType.java
@@ -11,8 +11,8 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 
 /**
  * A representation of the CtrType datatype
@@ -36,4 +36,8 @@
 	 * @return String representation of the datatype's name
 	 */
 	public abstract String type_name();
+	
+	public Object getNativeValue() {
+		return string_value();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/DocType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/DocType.java
index 30dc186..628c7c4 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/DocType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/DocType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,14 +8,16 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Moller - bug 275610 - Avoid big time and memory overhead for externals
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.w3c.dom.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+import org.w3c.dom.Document;
 
 /**
  * A representation of the DocumentType datatype
@@ -51,7 +53,6 @@
 	 * 
 	 * @return "document" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return DOCUMENT;
 	}
@@ -61,8 +62,7 @@
 	 * 
 	 * @return String representation of the document being stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		// XXX caching
 		if (_string_value == null)
 			_string_value = ElementType.textnode_strings(_value);
@@ -75,14 +75,9 @@
 	 * 
 	 * @return New ResultSequence consisting of the document being stored
 	 */
-	@Override
 	public ResultSequence typed_value() {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		// XXX no psvi
-		rs.add(new XSUntypedAtomic(string_value()));
-
-		return rs;
+		return new XSUntypedAtomic(getStringValue());
 	}
 
 	/**
@@ -90,7 +85,6 @@
 	 * 
 	 * @return QName representation of the name of the node
 	 */
-	@Override
 	public QName node_name() {
 		return null;
 	}
@@ -98,7 +92,6 @@
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isID() {
 		// TODO Auto-generated method stub
 		return false;
@@ -107,8 +100,12 @@
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isIDREF() {
 		return false;
 	}
+	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/ElementType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/ElementType.java
index c97fa49..5ab4738 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/ElementType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/ElementType.java
@@ -22,10 +22,11 @@
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import org.apache.xerces.dom.PSVIElementNSImpl;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -80,7 +81,6 @@
 	 * 
 	 * @return "element" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return ELEMENT;
 	}
@@ -90,8 +90,7 @@
 	 * 
 	 * @return String representation of the element being stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		// XXX can we cache ?
 		if (_string_value != null)
 			return _string_value;
@@ -106,27 +105,24 @@
 	 * 
 	 * @return New ResultSequence consisting of the element stored
 	 */
-	@Override
 	public ResultSequence typed_value() {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		
 		TypeDefinition typeDef = getType();
 
 		if (typeDef != null) {
 			if (!isNilled(_value)) {
 				if (typeDef != null) {
-					rs = getXDMTypedValue(typeDef, typeDef.getSimpleTypes(_value));
+					return getXDMTypedValue(typeDef, typeDef.getSimpleTypes(_value));
 				}
 				else {
-					rs.add(new XSUntypedAtomic(string_value()));
+					return new XSUntypedAtomic(getStringValue());
 				}
 			}
 		}
 		else {
-			rs.add(new XSUntypedAtomic(string_value()));
+			return new XSUntypedAtomic(getStringValue());
 		}
-		return rs;
+		return ResultBuffer.EMPTY;
 	}
 
 	private boolean isNilled(Element _value2) {
@@ -168,32 +164,26 @@
 	 * 
 	 * @return QName representation of the name of the node
 	 */
-	@Override
 	public QName node_name() {
 		QName name = new QName(_value.getPrefix(), _value.getLocalName(), _value.getNamespaceURI());
 
 		return name;
 	}
 
-	@Override
 	public ResultSequence nilled() {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		if (_value instanceof PSVIElementNSImpl) {
 			PSVIElementNSImpl psviElement = (PSVIElementNSImpl) _value;
-			rs.add(new XSBoolean(psviElement.getNil()));
+			return XSBoolean.valueOf(psviElement.getNil());
 		}
 		else {
-			rs.add(new XSBoolean(false));
+			return XSBoolean.FALSE;
 		}
-
-		return rs;
 	}
 
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isID() {
 		return isElementType(SCHEMA_TYPE_ID);
 	}
@@ -201,7 +191,6 @@
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isIDREF() {
 		return isElementType(SCHEMA_TYPE_IDREF);
 	}
@@ -210,5 +199,8 @@
 		TypeInfo typeInfo = _value.getSchemaTypeInfo();
 		return isType(typeInfo, typeName);
 	}
-
+	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNTYPED;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NodeItemTypeImpl.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NodeItemTypeImpl.java
new file mode 100644
index 0000000..c2b2f75
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NodeItemTypeImpl.java
@@ -0,0 +1,56 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types;
+
+import javax.xml.namespace.QName;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+
+public class NodeItemTypeImpl implements NodeItemType {
+
+	public NodeItemTypeImpl(short occurrence, short nodeType) {
+		this(occurrence, nodeType, null, null, true);
+	}
+
+	public NodeItemTypeImpl(short nodeType) {
+		this(OCCURRENCE_ONE, nodeType, null, null, true);
+	}
+
+	public NodeItemTypeImpl(short occurrence,
+			short nodeType,
+			TypeDefinition typeDefinition, 
+			QName name,
+			boolean wildcard) {
+		this.occurrence = occurrence;
+		this.typeDefinition = typeDefinition;
+		this.nodeType = nodeType;
+		this.name = name;
+		this.wildcard = wildcard;
+	}
+
+	private final short occurrence;
+	private final TypeDefinition typeDefinition;
+	private final short nodeType;
+	private final QName name;
+	private final boolean wildcard;
+
+	public short getOccurrence() {
+		return occurrence;
+	}
+
+	public TypeDefinition getTypeDefinition() {
+		return typeDefinition;
+	}
+
+	public boolean isWildcard() {
+		return wildcard;
+	}
+
+	public QName getName() {
+		return name;
+	}
+
+	public short getNodeType() {
+		return nodeType;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NodeType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NodeType.java
index cfb7ed4..bdec74b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NodeType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NodeType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,22 +18,26 @@
  *     Mukul Gandhi - bug 323900 - improving computing the typed value of element &
  *                                 attribute nodes, where the schema type of nodes
  *                                 are simple, with varieties 'list' and 'union'.                                 
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
+import java.util.TreeSet;
 
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.PrimitiveType;
 import org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
 import org.eclipse.wst.xml.xpath2.processor.PsychoPathTypeHelper;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Comment;
@@ -53,7 +57,13 @@
 	protected static final String SCHEMA_TYPE_ID = "ID";
 	private Node _node;
 	protected TypeModel _typeModel;
-		
+
+	public static final Comparator NODE_COMPARATOR = new Comparator() {
+		public int compare(Object o1, Object o2) {
+			return compare_node((NodeType)o1, (NodeType)o2);
+		}
+	};
+	
 	/**
 	 * Initialises according to the supplied parameters
 	 * 
@@ -112,6 +122,7 @@
 			return new AttrType((Attr) node, tm);
 
 		case Node.TEXT_NODE:
+		case Node.CDATA_SECTION_NODE:
 			return new TextType((Text) node, tm);
 
 		case Node.DOCUMENT_NODE:
@@ -130,7 +141,7 @@
 		return null;
 	}
 
-	public static ResultSequence eliminate_dups(ResultSequence rs) {
+	public static org.eclipse.wst.xml.xpath2.processor.ResultSequence eliminate_dups(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs) {
 		Hashtable added = new Hashtable(rs.size());
 
 		for (Iterator i = rs.iterator(); i.hasNext();) {
@@ -145,7 +156,7 @@
 		return rs;
 	}
 
-	public static ResultSequence sort_document_order(ResultSequence rs) {
+	public static org.eclipse.wst.xml.xpath2.processor.ResultSequence sort_document_order(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs) {
 		ArrayList res = new ArrayList(rs.size());
 
 		for (Iterator i = rs.iterator(); i.hasNext();) {
@@ -219,8 +230,7 @@
 	private static int compareDocuments(Document docA, Document docB) {
 		// Arbitrary but fulfills the spec (provided documenURI is always set)
 		if (docB.getDocumentURI() == null && docA.getDocumentURI() == null) {
-			// Best guess
-			return 0; 
+			return System.identityHashCode(docA) - System.identityHashCode(docB); 
 		}
 		return docB.getDocumentURI().compareTo(docA.getDocumentURI());
 	}
@@ -230,7 +240,7 @@
 	}
 
 	protected Object getTypedValueForPrimitiveType(TypeDefinition typeDef) {		
-		String strValue = string_value();
+		String strValue = getStringValue();
 		
 		if (typeDef == null) {
 		   return new XSUntypedAtomic(strValue);
@@ -243,59 +253,48 @@
 	/*
 	 * Construct the "typed value" from a "string value", given the simpleType of the node.
      */
-	protected ResultSequence getXDMTypedValue(TypeDefinition typeDef, List<Short> itemValTypes) {
-		
-		ResultSequence rs = ResultSequenceFactory.create_new();
+	protected ResultSequence getXDMTypedValue(TypeDefinition typeDef, List/*<Short>*/ itemValTypes) {
 		
 		if ("anySimpleType".equals(typeDef.getName()) || 
 		    "anyAtomicType".equals(typeDef.getName())) {
-			rs.add(new XSUntypedAtomic(string_value()));
+			return new XSUntypedAtomic(getStringValue());
 		}
 		else {
 			SimpleTypeDefinition simpType = null;
-			ResultSequence rsSimpleContent = null;
 
 			if (typeDef instanceof ComplexTypeDefinition) {
 				ComplexTypeDefinition complexTypeDefinition = (ComplexTypeDefinition) typeDef;
 				simpType = complexTypeDefinition.getSimpleType();
 				if (simpType != null) {
 					// element has a complexType with a simple content
-					rsSimpleContent = getTypedValueForSimpleContent(simpType, itemValTypes);
+					return getTypedValueForSimpleContent(simpType, itemValTypes);
 				}
 				else {
 					// element has a complexType with complex content
-					rs.add(new XSUntypedAtomic(string_value()));
+					return new XSUntypedAtomic(getStringValue());
 				}
 			} else {
 				// element has a simpleType
 				simpType = (SimpleTypeDefinition) typeDef;
-				rsSimpleContent = getTypedValueForSimpleContent(simpType, itemValTypes);
-			}
-
-			if (rsSimpleContent != null) {
-				rs =  rsSimpleContent;
+				return getTypedValueForSimpleContent(simpType, itemValTypes);
 			}
 		}
-			
-		return rs;
 		
 	} // getXDMTypedValue
 	
-	
-    /*
-     * Helper method to construct typed value of an XDM node.
+	/*
+     * Get the XDM typed value for schema "simple content model". 
      */
-	private ResultSequence getTypedValueForSimpleContent(SimpleTypeDefinition simpType, List<Short> itemValueTypes) {
+	private ResultSequence getTypedValueForSimpleContent(SimpleTypeDefinition simpType, List/*<Short>*/ itemValueTypes) {
 		
-		ResultSequence rs = ResultSequenceFactory.create_new();
+		ResultBuffer rs = new ResultBuffer();
 		
 		if (simpType.getVariety() == SimpleTypeDefinition.VARIETY_ATOMIC) {
-		   AnyType schemaTypeValue = SchemaTypeValueFactory.newSchemaTypeValue(PsychoPathTypeHelper.getXSDTypeShortCode(simpType), 
-				                                                               string_value());
+		   AnyType schemaTypeValue = SchemaTypeValueFactory.newSchemaTypeValue(PsychoPathTypeHelper.getXSDTypeShortCode(simpType), getStringValue());
 		   if (schemaTypeValue != null) {
-				rs.add(schemaTypeValue);
+				return schemaTypeValue;
 		   } else {
-				rs.add(new XSUntypedAtomic(string_value()));
+			   return new XSUntypedAtomic(getStringValue());
 		   }
 		}
 		else if (simpType.getVariety() == SimpleTypeDefinition.VARIETY_LIST) {
@@ -305,7 +304,7 @@
 			getTypedValueForVarietyUnion(simpType, rs);
 		}
 		
-		return rs;
+		return rs.getSequence();
 		
 	} // getTypedValueForSimpleContent
 	
@@ -313,10 +312,10 @@
 	/*
 	 * If the variety of simpleType was 'list', add the typed "list item" values to the parent result set. 
 	 */
-	private void addAtomicListItemsToResultSet(SimpleTypeDefinition simpType, List<Short> itemValueTypes, ResultSequence rs) {
+	private void addAtomicListItemsToResultSet(SimpleTypeDefinition simpType, List/*<Short>*/ itemValueTypes, ResultBuffer rs) {
 		
 		// tokenize the string value by a 'longest sequence' of white-spaces. this gives us the list items as string values.
-		String[] listItemsStrValues = string_value().split("\\s+");
+		String[] listItemsStrValues = getStringValue().split("\\s+");
 		
 		SimpleTypeDefinition itemType = (SimpleTypeDefinition) simpType.getItemType();		
 		if (itemType.getVariety() == SimpleTypeDefinition.VARIETY_ATOMIC) {
@@ -331,7 +330,7 @@
 		    // here the list items may have different atomic types
 			for (int listItemIdx = 0; listItemIdx < listItemsStrValues.length; listItemIdx++) {
 				String listItem = listItemsStrValues[listItemIdx];
-				rs.add(SchemaTypeValueFactory.newSchemaTypeValue(itemValueTypes.get(listItemIdx), listItem));
+				rs.add(SchemaTypeValueFactory.newSchemaTypeValue(((Short)itemValueTypes.get(listItemIdx)).shortValue(), listItem));
 			}
 		}
 		
@@ -343,15 +342,15 @@
 	 * to be returned as the typed value of the parent node, by considering the member types of the union (i.e
 	 * whichever member type first in order, can successfully validate the string value of the parent node).
 	 */
-	private void getTypedValueForVarietyUnion(SimpleTypeDefinition simpType, ResultSequence rs) {
+	private void getTypedValueForVarietyUnion(SimpleTypeDefinition simpType, ResultBuffer rs) {
 		
-		List<SimpleTypeDefinition> memberTypes = simpType.getMemberTypes();
+		List/*<SimpleTypeDefinition>*/ memberTypes = simpType.getMemberTypes();
 		// check member types in order, to find that which one can successfully validate the string value.
 		for (int memTypeIdx = 0; memTypeIdx < memberTypes.size(); memTypeIdx++) {
 			PrimitiveType memSimpleType = (PrimitiveType) memberTypes.get(memTypeIdx);
-		   if (isValueValidForSimpleType(string_value(), memSimpleType)) {
+		   if (isValueValidForSimpleType(getStringValue(), memSimpleType)) {
 			  
-			   rs.add(SchemaTypeValueFactory.newSchemaTypeValue(PsychoPathTypeHelper.getXSDTypeShortCode(memSimpleType), string_value()));
+			   rs.add(SchemaTypeValueFactory.newSchemaTypeValue(PsychoPathTypeHelper.getXSDTypeShortCode(memSimpleType), getStringValue()));
 			   // no more memberTypes need to be checked
 			   break; 
 		   }
@@ -405,5 +404,18 @@
 			 return null;
 		}
 	}
-	
+
+	public Object getNativeValue() {
+		return node_value();
+	}
+
+	public TypeModel getTypeModel() {
+		return _typeModel;
+	}
+
+	public static ResultBuffer linarize(ResultBuffer rs) {
+		TreeSet all = new TreeSet(NODE_COMPARATOR);
+		all.addAll(rs.getCollection());
+		return new ResultBuffer().concat(all);
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NumericType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NumericType.java
index 6b52f58..74731ed 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NumericType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/NumericType.java
@@ -11,9 +11,18 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathDiv;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathIDiv;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathMinus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathMod;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathPlus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathTimes;
 
 /**
  * A representation of the NumericType datatype
@@ -80,7 +89,7 @@
 	
 	public abstract NumericType round_half_to_even(int precision);
 
-	protected AnyType get_single_arg(ResultSequence rs) throws DynamicError {
+	protected Item get_single_arg(ResultSequence rs) throws DynamicError {
 		if (rs.size() != 1)
 			DynamicError.throw_type_error();
 
@@ -98,7 +107,7 @@
 	 * @throws DynamicError
 	 *             If node being tested is not of expected type
 	 */
-	public static AnyType get_single_type(AnyType at, Class type)
+	public static Item get_single_type(Item at, Class type)
 			throws DynamicError {
 
 		if (!type.isInstance(at))
@@ -107,6 +116,11 @@
 		return at;
 	}
 
+	public static Item get_single_type(AnyType at, Class type)
+	throws DynamicError {
+		return get_single_type((Item)at, type);
+	}
+
 	/***
 	 * Check whether first node in supplied ResultSequence is of the supplied
 	 * type
@@ -124,11 +138,11 @@
 		if (rs.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = rs.first();
+		Item at = rs.first();
 
 		if (!type.isInstance(at))
 			DynamicError.throw_type_error();
 
-		return at;
+		return (AnyType) at;
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/PIType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/PIType.java
index 04e9baf..13c1674 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/PIType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/PIType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,14 +9,16 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Jesper Moller- bug 275610 - Avoid big time and memory overhead for externals
  *     David Carver  - bug 281186 - implementation of fn:id and fn:idref
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.w3c.dom.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+import org.w3c.dom.ProcessingInstruction;
 
 /**
  * A representation of the ProcessingInstruction datatype
@@ -52,7 +54,6 @@
 	 * 
 	 * @return "processing-instruction" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return PROCESSING_INSTRUCTION;
 	}
@@ -63,8 +64,7 @@
 	 * 
 	 * @return String representation of the actual processing instruction stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value.getData();
 	}
 
@@ -75,13 +75,8 @@
 	 * @return New ResultSequence consisting of the processing instruction
 	 *         stored
 	 */
-	@Override
 	public ResultSequence typed_value() {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(new XSString(string_value()));
-
-		return rs;
+		return new XSString(getStringValue());
 	}
 
 	/**
@@ -89,7 +84,6 @@
 	 * 
 	 * @return A QName representation of the node's name
 	 */
-	@Override
 	public QName node_name() {
 		QName name = new QName(null, _value.getTarget());
 
@@ -101,7 +95,6 @@
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isID() {
 		return false;
 	}
@@ -109,8 +102,11 @@
 	/**
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isIDREF() {
 		return false;
 	}
+	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNTYPEDATOMIC;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/QName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/QName.java
index c06c464..0feca1b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/QName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/QName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2011 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,15 +9,20 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Jesper Moller- bug 281159 - debugging convenience toString method 
  *     David Carver (STAR) - bug 288886 - add unit tests and fix fn:resolve-qname function
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import javax.xml.XMLConstants;
+
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of a QName datatype (name of a node)
@@ -78,6 +83,12 @@
 		this(null, null);
 	}
 
+	public QName(javax.xml.namespace.QName name) {
+		this(XMLConstants.DEFAULT_NS_PREFIX.equals(name.getPrefix()) ? null : name.getPrefix(), name.getLocalPart());
+		if (! XMLConstants.NULL_NS_URI.equals(name.getNamespaceURI())) set_namespace(name.getNamespaceURI());
+		_expanded = true; 
+	}
+
 	/**
 	 * Creates a new QName by parsing a String representation of the node name
 	 * 
@@ -87,10 +98,12 @@
 	 */
 	public static QName parse_QName(String str) {
 		int occurs = 0;
-		for (Character ch : str.toCharArray()) {
-			if (ch == ':') {
-				occurs +=1;
-			}
+		
+		char[] strChrArr = str.toCharArray();		
+		for (int chrIndx = 0; chrIndx < strChrArr.length; chrIndx++) {
+		  if (strChrArr[chrIndx] == ':') {
+			 occurs += 1;  
+		  }
 		}
 		
 		if (occurs > 1) {
@@ -118,10 +131,7 @@
 	 * @return New ResultSequence consisting of the QName supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
 			DynamicError.throw_type_error();
 
@@ -130,14 +140,12 @@
 		if (!(aat instanceof XSString) && !(aat instanceof QName))
 			DynamicError.throw_type_error();
 		
-		String sarg = aat.string_value();
+		String sarg = aat.getStringValue();
 
 		QName qname = parse_QName(sarg);
 		if (qname == null)
 			return null;
-		rs.add(qname);
-
-		return rs;
+		return qname;
 	}
 
 	/**
@@ -146,8 +154,7 @@
 	 * 
 	 * @return String representation of the node name
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return string();
 	}
 
@@ -156,7 +163,6 @@
 	 * 
 	 * @return "xs:QName" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_Q_NAME;
 	}
@@ -166,7 +172,6 @@
 	 * 
 	 * @return "QName" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "QName";
 	}
@@ -222,7 +227,7 @@
 	 *            Namespace this node belongs in
 	 */
 	public void set_namespace(String n) {
-		_namespace = n;
+		_namespace = n != null ? (n.length() == 0 ? null : n) : null;
 		_expanded = true;
 	}
 
@@ -262,7 +267,6 @@
 	 *            The object to compare with. Should be of type QName
 	 * @return True if the two represent the same node. False otherwise
 	 */
-	@Override
 	public boolean equals(Object obj) {
 
 		// make sure we are comparing a qname
@@ -305,7 +309,6 @@
 	 * 
 	 * @return The hashcode for the full pathname
 	 */
-	@Override
 	public int hashCode() {
 		int namespace = 3;
 		int local = 4;
@@ -335,13 +338,25 @@
 	 * @return True if the two represent the same node. False otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		QName val = (QName) NumericType.get_single_type(arg, QName.class);
 		return equals(val);
 	}
 	
-	@Override
 	public String toString() {
 		return string();
 	}
+	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_QNAME;
+	}
+
+	public javax.xml.namespace.QName asQName() {
+		return new javax.xml.namespace.QName(namespace(), local(), prefix() != null ? prefix() : XMLConstants.DEFAULT_NS_PREFIX);
+	}
+	
+	@Override
+	public Object getNativeValue() {
+		return asQName();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SchemaTypeValueFactory.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SchemaTypeValueFactory.java
index 19dba85..d594563 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SchemaTypeValueFactory.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SchemaTypeValueFactory.java
@@ -10,7 +10,8 @@
  *     Mukul Gandhi - bug 318313 - improvements to computation of typed values of nodes, when validated by XML Schema 
  *                                 primitive types.
  *     Mukul Gandhi - bug 323900 - improving computing the typed value of element and attribute nodes, where the schema
- *                                 type of nodes are simple, with varieties 'list' and 'union'.                                 
+ *                                 type of nodes are simple, with varieties 'list' and 'union'.
+ *     Mukul Gandhi - bug 341862 - improvements to computation of typed value of xs:boolean nodes.                                                                  
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
@@ -34,7 +35,8 @@
 		}
 		
 		if (typeDef == XSConstants.BOOLEAN_DT) {
-			return new XSBoolean(Boolean.valueOf(strValue).booleanValue());
+			String newStrValue = ("1".equals(strValue) || "true".equals(strValue)) ? "true" : "false";
+			return new XSBoolean(Boolean.valueOf(newStrValue).booleanValue());
 		}
 		
 		if (typeDef == XSConstants.DATE_DT) {       
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleAtomicItemTypeImpl.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleAtomicItemTypeImpl.java
new file mode 100644
index 0000000..ea06d86
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleAtomicItemTypeImpl.java
@@ -0,0 +1,31 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types;
+
+import org.eclipse.wst.xml.xpath2.api.AtomicItemType;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+
+public class SimpleAtomicItemTypeImpl implements AtomicItemType {
+
+	private final short occurrence;
+	private final TypeDefinition typeDefinition;
+
+	public SimpleAtomicItemTypeImpl(TypeDefinition typeDefinition) {
+		super();
+		this.typeDefinition = typeDefinition;
+		this.occurrence = OCCURRENCE_ONE;
+	}
+
+	public SimpleAtomicItemTypeImpl(TypeDefinition typeDefinition, short occurrence) {
+		super();
+		this.typeDefinition = typeDefinition;
+		this.occurrence = occurrence;
+	}
+
+	public short getOccurrence() {
+		return this.occurrence;
+	}
+
+	public TypeDefinition getTypeDefinition() {
+		return typeDefinition;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/TextType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/TextType.java
index c5456f8..158e88a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/TextType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/TextType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,14 +9,16 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     Jesper Moller- bug 275610 - Avoid big time and memory overhead for externals
  *     David Carver  - bug 281186 - implementation of fn:id and fn:idref
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.w3c.dom.*;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+import org.w3c.dom.Text;
 
 /**
  * A representation of the TextType datatype
@@ -41,7 +43,6 @@
 	 * 
 	 * @return "text" which is the datatype's name
 	 */
-	@Override
 	public String string_type() {
 		return TEXT;
 	}
@@ -51,8 +52,7 @@
 	 * 
 	 * @return String representation of the actual value stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value.getNodeValue();
 	}
 
@@ -61,13 +61,8 @@
 	 * 
 	 * @return New ResultSequence consisting of the Text value stored
 	 */
-	@Override
 	public ResultSequence typed_value() {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
-		rs.add(new XSUntypedAtomic(_value.getData()));
-
-		return rs;
+		return new XSUntypedAtomic(_value.getData());
 	}
 
 	/**
@@ -75,7 +70,6 @@
 	 * 
 	 * @return null (no user defined name for this node gets defined)
 	 */
-	@Override
 	public QName node_name() {
 		return null;
 	}
@@ -84,7 +78,6 @@
 	 * Will always return false;
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isID() {
 
 		return false;
@@ -94,8 +87,11 @@
 	 * 
 	 * @since 1.1
 	 */
-	@Override
 	public boolean isIDREF() {
 		return false;
 	}
+	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNTYPEDATOMIC;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XPathDecimalFormat.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XPathDecimalFormat.java
index 2443712..01f6e48 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XPathDecimalFormat.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XPathDecimalFormat.java
@@ -8,6 +8,7 @@
  * Contributors:
  *    David Carver - initial API and implementation
  *    Jesper Steen Moller - bug 283404 - fixed locale
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
@@ -53,7 +54,7 @@
 
 	private String formatXPath(Object obj) {
 		String curPattern = toPattern();
-		String newPattern = curPattern.replace("E0", "");
+		String newPattern = curPattern.replaceAll("E0", "");
 		if (obj instanceof Float) {
             return formatFloatValue(obj, curPattern, newPattern);
 		}
@@ -78,22 +79,22 @@
 
 	private void doubleXPathPattern(Object obj, String curPattern,
 			String newPattern) {
-		BigDecimal doubValue = BigDecimal.valueOf(((Double) obj));
+		BigDecimal doubValue = new BigDecimal((((Double) obj)).doubleValue());
 		BigDecimal minValue = new BigDecimal("-1E6");
 		BigDecimal maxValue = new BigDecimal("1E6");
 		if (doubValue.compareTo(minValue) > 0 && doubValue.compareTo(maxValue) < 0) {
 			applyPattern(newPattern);
 		} else { //if (doubValue.compareTo(minValue) < 0) {
-			applyPattern(curPattern.replace("0.#", "0.0"));
+			applyPattern(curPattern.replaceAll("0\\.#", "0.0"));
 		}
 	}
 
 	private boolean isDoublePositiveInfinity(Double doubleValue) {
-		return doubleValue == Double.POSITIVE_INFINITY;
+		return doubleValue.doubleValue() == Double.POSITIVE_INFINITY;
 	}
 
 	private boolean isDoubleNegativeInfinity(Double doubleValue) {
-		return doubleValue == Double.NEGATIVE_INFINITY;
+		return doubleValue.doubleValue() == Double.NEGATIVE_INFINITY;
 	}
 
 	private String formatFloatValue(Object obj, String curPattern,
@@ -110,20 +111,20 @@
 	}
 
 	private boolean isFloatPosInfinity(Float floatValue) {
-		return floatValue == Float.POSITIVE_INFINITY;
+		return floatValue.floatValue() == Float.POSITIVE_INFINITY;
 	}
 
 	private boolean isFloatNegInfinity(Float floatValue) {
-		return floatValue == Float.NEGATIVE_INFINITY;
+		return floatValue.floatValue() == Float.NEGATIVE_INFINITY;
 	}
 
 	private void floatXPathPattern(String curPattern, String newPattern,
 			Float floatValue) {
-		if (floatValue > -1E6f && floatValue < 1E6f) {
+		if (floatValue.floatValue() > -1E6f && floatValue.floatValue() < 1E6f) {
 			
 			applyPattern(newPattern);
-		} else if (floatValue <= -1E6f) {
-			applyPattern(curPattern.replace("0.#", "0.0" ));
+		} else if (floatValue.floatValue() <= -1E6f) {
+			applyPattern(curPattern.replaceAll("0\\.#", "0.0" ));
 		}
 	}
 	
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSAnyURI.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSAnyURI.java
index 0e1a4bb..b14a15c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSAnyURI.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSAnyURI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,17 +12,20 @@
  *         untypedAtomic, and anyURI are allowed.
  *     David Carver (STAR) - bug 283777 - implemented gt, lt comparison code.
  *     Jesper Steen Moller - bug 281159 - added promotion of xs:anyURI to string (reverse case) 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * Represents a Universal Resource Identifier (URI) reference
@@ -54,7 +57,6 @@
 	 * 
 	 * @return "xs:anyURI", the full type pathname of this datatype
 	 */
-	@Override
 	public String string_type() {
 		return XS_ANY_URI;
 	}
@@ -64,7 +66,6 @@
 	 * 
 	 * @return "anyURI", the type name of this datatype
 	 */
-	@Override
 	public String type_name() {
 		return "anyURI";
 	}
@@ -76,7 +77,6 @@
 	 * @return the URI value held by this instance of the URI datatype as a
 	 *         String
 	 */
-	@Override
 	public String string_value() {
 		return _value;
 	}
@@ -90,14 +90,11 @@
 	 * @throws DynamicError
 	 * @return new result sequence consisting of the URI supplied
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		AnyType aat = arg.first();
+		AnyType aat = (AnyType) arg.first();
 
 		if (!(aat.string_type().equals("xs:string")
 				|| aat.string_type().equals(XS_ANY_URI) || aat.string_type()
@@ -105,9 +102,7 @@
 			throw DynamicError.invalidType();
 		}
 
-		rs.add(new XSAnyURI(aat.string_value()));
-
-		return rs;
+		return new XSAnyURI(aat.string_value());
 	}
 
 	/**
@@ -120,7 +115,7 @@
 	 *         otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		if (arg instanceof XSAnyURI || arg instanceof XSString) {
 			if (this.string_value().equals(arg.string_value())) {
 				return true;
@@ -171,4 +166,11 @@
 		return false;
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_ANYURI;
+	}
+
+	public String getStringValue() {
+		return _value;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBase64Binary.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBase64Binary.java
index ec96803..3fe9b9c 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBase64Binary.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBase64Binary.java
@@ -7,17 +7,20 @@
  *
  * Contributors:
  *     Mukul Gandhi - bug 281046 - initial API and implementation 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import org.apache.xerces.impl.dv.util.Base64;
 import org.apache.xerces.impl.dv.util.HexBin;
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the base64Binary datatype
@@ -49,7 +52,6 @@
 	 * 
 	 * @return "xs:base64Binary" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_BASE64_BINARY;
 	}
@@ -59,7 +61,6 @@
 	 * 
 	 * @return "base64Binary" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "base64Binary";
 	}
@@ -70,8 +71,7 @@
 	 * 
 	 * @return The base64Binary stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value;
 	}
 
@@ -93,12 +93,10 @@
 	 * @return New ResultSequence representing base64Binary value 
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration ||
@@ -111,7 +109,7 @@
 			throw DynamicError.cant_cast(null);
 		}
 		
-		String str_value = aat.string_value();
+		String str_value = aat.getStringValue();
 		
 		byte[] decodedValue = Base64.decode(str_value);
 		
@@ -122,14 +120,12 @@
 			decodedValue = str_value.getBytes();
 		}
 		if (decodedValue != null) {
-		  rs.add(new XSBase64Binary(new String(decodedValue)));
+		  return new XSBase64Binary(new String(decodedValue));
 		}
 		else {
 		  // invalid base64 string
 		  throw DynamicError.throw_type_error();	
 		}
-
-		return rs;
 	}
 
 	private boolean isCastable(AnyAtomicType aat) {
@@ -154,8 +150,8 @@
 	 *         
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
-      String valToCompare = arg.string_value();
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
+      String valToCompare = arg.getStringValue();
       
       byte[] value1 = Base64.decode(_value);
       byte[] value2 = Base64.decode(valToCompare);
@@ -177,4 +173,11 @@
       return true;
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_BASE64BINARY;
+	}
+
+	public Object getNativeValue() {
+		return Base64.decode(_value);
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBoolean.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBoolean.java
index 8f0fdf5..c2a3726 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBoolean.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSBoolean.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,23 +9,29 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0 
  *     Mukul Gandhi - bug274784 - improvements to xs:boolean data type implementation
  *     David Carver - bug 282223 - corrected casting to boolean.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of a true or a false value.
  */
 public class XSBoolean extends CtrType implements CmpEq, CmpGt, CmpLt {
 	private static final String XS_BOOLEAN = "xs:boolean";
+	public static final XSBoolean TRUE = new XSBoolean(true);
+	public static final XSBoolean FALSE = new XSBoolean(false);
 	private boolean _value;
 
 	/**
@@ -50,17 +56,20 @@
 	 * 
 	 * @return "xs:boolean", the full datatype pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_BOOLEAN;
 	}
 
+	@Override
+	public Object getNativeValue() {
+		return Boolean.valueOf(_value);
+	}
+	
 	/**
 	 * Retrieve the datatype name
 	 * 
 	 * @return "boolean", which is the datatype name.
 	 */
-	@Override
 	public String type_name() {
 		return "boolean";
 	}
@@ -70,8 +79,7 @@
 	 * 
 	 * @return the String representation of the boolean value stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return "" + _value;
 	}
 
@@ -93,14 +101,11 @@
 	 * @throws DynamicError
 	 * @return A new result sequence consisting of the boolean value supplied.
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-		  return rs;
+		  return ResultBuffer.EMPTY;
 		
-		AnyType anyType = arg.first();
+		Item anyType = arg.first();
 		
 		if (anyType instanceof XSDuration || anyType instanceof CalendarType ||
 			anyType instanceof XSBase64Binary || anyType instanceof XSHexBinary ||
@@ -108,24 +113,14 @@
 			throw DynamicError.invalidType();
 		}
 		
-		String str_value = anyType.string_value();
+		String str_value = anyType.getStringValue();
 		
 		
 		if (!(isCastable(anyType, str_value))) {
 		   throw DynamicError.cant_cast(null);
 		}
 
-		Boolean b = null;
-		if (isFalse(str_value)) {
-		  b = Boolean.FALSE;	
-		}
-		else {
-		  b = Boolean.TRUE;		
-		}
-		
-		rs.add(new XSBoolean(b.booleanValue()));
-
-		return rs;
+		return XSBoolean.valueOf(! isFalse(str_value));
 	}
 
 	private boolean isFalse(String str_value) {
@@ -134,7 +129,7 @@
 		    str_value.equals("0.0E0") || str_value.equals("NaN");
 	}
 
-	private boolean isCastable(AnyType anyType, String str_value) {
+	private boolean isCastable(Item anyType, String str_value) {
 		return str_value.equals("0") || str_value.equals("1") || 
 			 str_value.equals("true") || str_value.equals("false") ||
 			 anyType instanceof NumericType;
@@ -153,8 +148,8 @@
 	 * @return New XSBoolean representation of true/false result of the equality
 	 *         comparison
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
-		XSBoolean barg = (XSBoolean) NumericType.get_single_type(arg,
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
+		XSBoolean barg = (XSBoolean) NumericType.get_single_type((Item)arg,
 				XSBoolean.class);
 
 		return value() == barg.value();
@@ -173,7 +168,7 @@
 	 *         comparison
 	 */
 	public boolean gt(AnyType arg, DynamicContext context) throws DynamicError {
-		XSBoolean barg = (XSBoolean) NumericType.get_single_type(arg,
+		XSBoolean barg = (XSBoolean) NumericType.get_single_type((Item)arg,
 				XSBoolean.class);
 
 		boolean result = false;
@@ -196,7 +191,7 @@
 	 *         comparison
 	 */
 	public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
-		XSBoolean barg = (XSBoolean) NumericType.get_single_type(arg,
+		XSBoolean barg = (XSBoolean) NumericType.get_single_type((Item)arg,
 				XSBoolean.class);
 
 		boolean result = false;
@@ -206,4 +201,13 @@
 		return result;
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_BOOLEAN;
+	}
+
+	public static org.eclipse.wst.xml.xpath2.api.ResultSequence valueOf(
+			boolean answer) {
+		return answer ? TRUE : FALSE;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSByte.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSByte.java
index 09f3047..80e7f3b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSByte.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSByte.java
@@ -8,15 +8,19 @@
  * Contributors:
  *     Mukul Gandhi - bug 277639 - implementation of xs:byte data type
  *     David Carver - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSByte extends XSShort {
 	
@@ -44,7 +48,6 @@
 	 * 
 	 * @return "xs:byte" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_BYTE;
 	}
@@ -54,7 +57,6 @@
 	 * 
 	 * @return "byte" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "byte";
 	}
@@ -68,19 +70,16 @@
 	 * @return New ResultSequence consisting of the 'byte' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a byte.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			BigInteger min = BigInteger.valueOf(-128L);
@@ -91,13 +90,15 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSByte(bigInt));
-			
-			return rs;
+			return new XSByte(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_BYTE;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDate.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDate.java
index f42b667..146678a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDate.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,23 +13,32 @@
  *                                 fixed casting issue. 
  *     David Carver - bug 280547 - fix dates for comparison 
  *     Jesper Steen Moller  - bug 262765 - fix type tests
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathMinus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathPlus;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+
 /**
  * Representation of a date of the form year-month-day and optional timezone
  */
@@ -73,7 +82,6 @@
 	 * 
 	 * @return "date" which is the dataype name
 	 */
-	@Override
 	public String type_name() {
 		return "date";
 	}
@@ -83,7 +91,6 @@
 	 * 
 	 * @return A copy of this date representation
 	 */
-	@Override
 	public Object clone() throws CloneNotSupportedException {
 		Calendar c = (Calendar) calendar().clone();
 		XSDuration t = tz();
@@ -146,14 +153,11 @@
 	 * @throws DynamicError
 	 * @return A new result sequence consisting of the date value supplied.
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		if (!isCastable(aat)) {
 			throw DynamicError.invalidType();
@@ -164,12 +168,10 @@
 		if (dt == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(dt);
-
-		return rs;
+		return dt;
 	}
 
-	private boolean isCastable(AnyType aat) {
+	private boolean isCastable(Item aat) {
 
 		// We might be able to cast these.
 		if (aat instanceof XSString || aat instanceof XSUntypedAtomic
@@ -193,7 +195,7 @@
 		return false;
 	}
 
-	private XSDate castDate(AnyType aat) {
+	private XSDate castDate(Item aat) {
 		if (aat instanceof XSDate) {
 			XSDate date = (XSDate) aat;
 			return new XSDate(date.calendar(), date.tz());
@@ -204,7 +206,7 @@
 			return new XSDate(dateTime.calendar(), dateTime.tz());
 		}
 
-		return parse_date(aat.string_value());
+		return parse_date(aat.getStringValue());
 	}
 
 	/**
@@ -253,8 +255,7 @@
 	 * 
 	 * @return String representation of the date stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "";
 
 		Calendar adjustFortimezone = calendar();
@@ -301,7 +302,6 @@
 	 * 
 	 * @return "xs:date" which is the datatype full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_DATE;
 	}
@@ -335,8 +335,8 @@
 	 * @return True if the two dates are represent the same exact point in time.
 	 *         False otherwise.
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
-		XSDate val = (XSDate) NumericType.get_single_type(arg, XSDate.class);
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
+		XSDate val = (XSDate) NumericType.get_single_type((Item)arg, XSDate.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
 		Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());
 
@@ -353,7 +353,7 @@
 	 *         otherwise.
 	 */
 	public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
-		XSDate val = (XSDate) NumericType.get_single_type(arg, XSDate.class);
+		XSDate val = (XSDate) NumericType.get_single_type((Item)arg, XSDate.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
 		Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());
 
@@ -370,7 +370,7 @@
 	 *         otherwise.
 	 */
 	public boolean gt(AnyType arg, DynamicContext context) throws DynamicError {
-		XSDate val = (XSDate) NumericType.get_single_type(arg, XSDate.class);
+		XSDate val = (XSDate) NumericType.get_single_type((Item)arg, XSDate.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
 		Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());
 
@@ -408,7 +408,7 @@
 		if (arg.size() != 1)
 			throw DynamicError.throw_type_error();
 
-		AnyType at = arg.first();
+		Item at = arg.first();
 
 		if (!(at instanceof XSDate) && !(at instanceof XSYearMonthDuration)
 				&& !(at instanceof XSDayTimeDuration)) {
@@ -420,11 +420,11 @@
 		}
 		
 		if (at instanceof XSYearMonthDuration) {
-			return minusXSYearMonthDuration(at);
+			return minusXSYearMonthDuration((XSYearMonthDuration)at);
 		}
 		
 		if (at instanceof XSDayTimeDuration) {
-			return minusXSDayTimeDuration(at);
+			return minusXSDayTimeDuration((XSDayTimeDuration)at);
 		}
 
 		return null;
@@ -435,20 +435,15 @@
 
 		try {
 			XSDate res = (XSDate) clone();
-			try {
-				XMLGregorianCalendar xmlCal = DatatypeFactory.newInstance()
-						.newXMLGregorianCalendar(
-								(GregorianCalendar) calendar());
-				Duration dtduration = DatatypeFactory.newInstance()
-						.newDuration(val.string_value());
-				xmlCal.add(dtduration.negate());
-				res = new XSDate(xmlCal.toGregorianCalendar(), res.tz());
-			} catch (DatatypeConfigurationException ex) {
-
-			}
+			XMLGregorianCalendar xmlCal = _datatypeFactory
+					.newXMLGregorianCalendar(
+							(GregorianCalendar) calendar());
+			Duration dtduration = _datatypeFactory
+					.newDuration(val.getStringValue());
+			xmlCal.add(dtduration.negate());
+			res = new XSDate(xmlCal.toGregorianCalendar(), res.tz());
 			return ResultSequenceFactory.create_new(res);
 		} catch (CloneNotSupportedException ex) {
-
 		}
 		return null;
 	}
@@ -469,19 +464,13 @@
 	private ResultSequence minusXSDate(ResultSequence arg) throws DynamicError {
 		XSDate val = (XSDate) NumericType.get_single_type(arg, XSDate.class);
 		Duration dtduration = null;
-		try {
-			Calendar thisCal = normalizeCalendar(calendar(), tz());
-			Calendar thatCal = normalizeCalendar(val.calendar(), val.tz());
-			long duration = thisCal.getTimeInMillis()
-					- thatCal.getTimeInMillis();
-			dtduration = DatatypeFactory.newInstance().newDuration(duration);
-			return ResultSequenceFactory.create_new(XSDayTimeDuration
-					.parseDTDuration(dtduration.toString()));
-
-		} catch (DatatypeConfigurationException ex) {
-
-		}
-		return null;
+		Calendar thisCal = normalizeCalendar(calendar(), tz());
+		Calendar thatCal = normalizeCalendar(val.calendar(), val.tz());
+		long duration = thisCal.getTimeInMillis()
+				- thatCal.getTimeInMillis();
+		dtduration = _datatypeFactory.newDuration(duration);
+		return ResultSequenceFactory.create_new(XSDayTimeDuration
+				.parseDTDuration(dtduration.toString()));
 	}
 
 	/**
@@ -501,7 +490,7 @@
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg.first();
+		Item at = arg.first();
 
 		try {
 			if (at instanceof XSYearMonthDuration) {
@@ -536,5 +525,8 @@
 		}
 
 	}
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_DATE;
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDateTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDateTime.java
index daa33f3..9900fc9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDateTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDateTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,23 +12,32 @@
  *     David Carver - bug 282223 - implementation of xs:duration.
  *                  - bug 262765 - additional tweak to convert 24:00:00 to 00:00:00
  *     David Carver - bug 280547 - fix dates for comparison 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathMinus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathPlus;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+
 /**
  * A representation of a date and time (and optional timezone)
  */
@@ -66,7 +75,6 @@
 	 * 
 	 * @return A copy of this date and time representation
 	 */
-	@Override
 	public Object clone() throws CloneNotSupportedException {
 		Calendar c = (Calendar) calendar().clone();
 		XSDuration t = tz();
@@ -89,7 +97,6 @@
 	 * 
 	 * @return "dateTime" which is the dataype name
 	 */
-	@Override
 	public String type_name() {
 		return "dateTime";
 	}
@@ -492,12 +499,9 @@
 	 * @return A new result sequence consisting of the date and time value
 	 *         supplied.
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration
@@ -516,9 +520,7 @@
 		if (dt == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(dt);
-
-		return rs;
+		return dt;
 	}
 
 	private boolean isCastable(AnyAtomicType aat) {
@@ -548,7 +550,7 @@
 			return new XSDateTime(dateTime.calendar(), dateTime.tz());
 		}
 
-		return parseDateTime(aat.string_value());
+		return parseDateTime(aat.getStringValue());
 	}
 
 	/**
@@ -657,8 +659,7 @@
 	 * 
 	 * @return String representation of the date and time stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "";
 
 		Calendar adjustFortimezone = calendar();
@@ -725,7 +726,6 @@
 	 * 
 	 * @return "xs:dateTime" which is the datatype full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_DATE_TIME;
 	}
@@ -750,7 +750,7 @@
 	 * @return True if the two dates and times are represent the same exact
 	 *         point in time. False otherwise.
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSDateTime val = (XSDateTime) NumericType.get_single_type(arg,
 				XSDateTime.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
@@ -838,7 +838,7 @@
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg.first();
+		Item at = arg.first();
 
 		if (!(at instanceof XSDateTime) && !(at instanceof XSYearMonthDuration)
 				&& !(at instanceof XSDayTimeDuration)) {
@@ -865,39 +865,25 @@
 		XSDateTime val = (XSDateTime) NumericType.get_single_type(arg,
 				XSDateTime.class);
 
-		Duration dtduration = null;
-		try {
-			Calendar thisCal = normalizeCalendar(calendar(), tz());
-			Calendar thatCal = normalizeCalendar(val.calendar(), val.tz());
-			long duration = thisCal.getTimeInMillis()
-					- thatCal.getTimeInMillis();
-			dtduration = DatatypeFactory.newInstance()
-					.newDuration(duration);
-			return ResultSequenceFactory.create_new(XSDayTimeDuration
-					.parseDTDuration(dtduration.toString()));
-		} catch (DatatypeConfigurationException ex) {
-
-		}
-		return null;
+		Calendar thisCal = normalizeCalendar(calendar(), tz());
+		Calendar thatCal = normalizeCalendar(val.calendar(), val.tz());
+		long duration = thisCal.getTimeInMillis()
+				- thatCal.getTimeInMillis();
+		Duration dtduration = _datatypeFactory.newDuration(duration);
+		return ResultSequenceFactory.create_new(XSDayTimeDuration
+				.parseDTDuration(dtduration.toString()));
 	}
 
-	private ResultSequence minusXSDayTimeDuration(AnyType at) {
+	private ResultSequence minusXSDayTimeDuration(Item at) {
 		XSDuration val = (XSDuration) at;
-
 		try {
 			XSDateTime res = (XSDateTime) clone();
-
-			try {
-				XMLGregorianCalendar xmlCal = DatatypeFactory
-						.newInstance()
-						.newXMLGregorianCalendar((GregorianCalendar) calendar());
-				Duration dtduration = DatatypeFactory.newInstance()
-						.newDuration(val.string_value());
-				xmlCal.add(dtduration.negate());
-				res = new XSDateTime(xmlCal.toGregorianCalendar(), res.tz());
-			} catch (DatatypeConfigurationException ex) {
-
-			}
+			XMLGregorianCalendar xmlCal = _datatypeFactory
+					.newXMLGregorianCalendar((GregorianCalendar) calendar());
+			Duration dtduration = _datatypeFactory
+					.newDuration(val.getStringValue());
+			xmlCal.add(dtduration.negate());
+			res = new XSDateTime(xmlCal.toGregorianCalendar(), res.tz());
 
 			return ResultSequenceFactory.create_new(res);
 		} catch (CloneNotSupportedException ex) {
@@ -906,7 +892,7 @@
 		return null;
 	}
 
-	private ResultSequence minusXSYearMonthDuration(AnyType at) {
+	private ResultSequence minusXSYearMonthDuration(Item at) {
 		XSYearMonthDuration val = (XSYearMonthDuration) at;
 
 		try {
@@ -938,7 +924,7 @@
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg.first();
+		Item at = arg.first();
 
 		try {
 			if (at instanceof XSYearMonthDuration) {
@@ -953,18 +939,13 @@
 
 				XSDateTime res = (XSDateTime) clone();
 
-				try {
-					XMLGregorianCalendar xmlCal = DatatypeFactory.newInstance()
-							.newXMLGregorianCalendar(
-									(GregorianCalendar) calendar());
-					Duration dtduration = DatatypeFactory.newInstance()
-							.newDuration(val.string_value());
-					xmlCal.add(dtduration);
-					res = new XSDateTime(xmlCal.toGregorianCalendar(), res.tz());
-				} catch (DatatypeConfigurationException ex) {
-
-				}
-
+				XMLGregorianCalendar xmlCal = _datatypeFactory
+						.newXMLGregorianCalendar(
+								(GregorianCalendar) calendar());
+				Duration dtduration = _datatypeFactory
+						.newDuration(val.getStringValue());
+				xmlCal.add(dtduration);
+				res = new XSDateTime(xmlCal.toGregorianCalendar(), res.tz());
 				return ResultSequenceFactory.create_new(res);
 			} else {
 				DynamicError.throw_type_error();
@@ -977,4 +958,8 @@
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_DATETIME;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDayTimeDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDayTimeDuration.java
index 5840ecf..6cd3935 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDayTimeDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDayTimeDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,20 +11,29 @@
  *     Mukul Gandhi - bug 279377 - improvements to multiplication and division operations
  *                                 on xs:dayTimeDuration.
  *     David Carver - bug 282223 - implementation of xs:duration
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.util.Calendar;
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
+
 import javax.xml.datatype.Duration;
+
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathDiv;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathMinus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathPlus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathTimes;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the DayTimeDuration datatype
@@ -78,24 +87,24 @@
 		super(0, 0, 0, 0, 0, 0.0, false);
 	}
 
+	public XSDayTimeDuration(Duration d) {
+		this(d.getDays(), d.getHours(), d.getMinutes(), 0.0, d.getSign() == -1);
+	}
+
 	/**
 	 * Creates a copy of this representation of a time duration
 	 * 
 	 * @return New XSDayTimeDuration representing the duration of time stored
 	 * @throws CloneNotSupportedException
 	 */
-	@Override
 	public Object clone() throws CloneNotSupportedException {
 		return new XSDayTimeDuration(days(), hours(), minutes(), seconds(),
 				negative());
 	}
 
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-	
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 	
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof CalendarType ||
@@ -113,9 +122,7 @@
 		if (dtd == null)
 			throw DynamicError.cant_cast(null);
 	
-		rs.add(dtd);
-	
-		return rs;
+		return dtd;
 	}
 	
 	private XSDuration castDayTimeDuration(AnyAtomicType aat) {
@@ -124,7 +131,7 @@
 			return new XSDayTimeDuration(duration.days(), duration.hours(), duration.minutes(), duration.seconds(), duration.negative());
 		}
 		
-		return parseDTDuration(aat.string_value());
+		return parseDTDuration(aat.getStringValue());
 	}
 
 	
@@ -229,7 +236,6 @@
 	 * 
 	 * @return "dayTimeDuration" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "dayTimeDuration";
 	}
@@ -239,7 +245,6 @@
 	 * 
 	 * @return "xs:dayTimeDuration" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_DAY_TIME_DURATION;
 	}
@@ -296,9 +301,9 @@
 		ResultSequence convertedRS = arg;
 		
 		if (arg.size() == 1) {
-			AnyType argValue = arg.first();
+			Item argValue = arg.first();
             if (argValue instanceof XSDecimal) {
-            	convertedRS = ResultSequenceFactory.create_new(new XSDouble(argValue.string_value()));	
+            	convertedRS = ResultSequenceFactory.create_new(new XSDouble(argValue.getStringValue()));	
             }
 		}
 		
@@ -327,7 +332,7 @@
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg.first();
+		Item at = arg.first();
 
 		if (at instanceof XSDouble) {
 			XSDouble dt = (XSDouble) at;
@@ -338,31 +343,29 @@
 			}
 			
 			if (!dt.zero()) {
-				BigDecimal ret = BigDecimal.ZERO;
+				BigDecimal ret = new BigDecimal(0);
 				
 				if (dt.infinite()) {
 					retval = value() / dt.double_value();
 				} else {
-					ret = BigDecimal.valueOf(value());
-					ret = ret.divide(BigDecimal.valueOf(dt.double_value()), 18, RoundingMode.HALF_EVEN);
+					ret = new BigDecimal(value());
+					ret = ret.divide(new BigDecimal(dt.double_value()), 18, BigDecimal.ROUND_HALF_EVEN);
 					retval = ret.doubleValue();
 				}
 			} else {
 				throw DynamicError.overflowUnderflow();
 			}
-//				ret = value() / dt.double_value();
-			
 
 			return ResultSequenceFactory
 					.create_new(new XSDayTimeDuration(retval));
 		} else if (at instanceof XSDecimal) {
 			XSDecimal dt = (XSDecimal) at;
 			
-			BigDecimal ret = BigDecimal.ZERO;
+			BigDecimal ret = new BigDecimal(0);
 							
 			if (!dt.zero()) {
-				ret = BigDecimal.valueOf(value());
-				ret = ret.divide(dt.getValue(), 18, RoundingMode.HALF_EVEN);
+				ret = new BigDecimal(value());
+				ret = ret.divide(dt.getValue(), 18, BigDecimal.ROUND_HALF_EVEN);
 			} else {
 				throw DynamicError.overflowUnderflow();
 			}
@@ -373,19 +376,9 @@
 			XSDuration md = (XSDuration) at;
 
 			BigDecimal res = null;
-			try {
-                Duration thisDuration  = DatatypeFactory.newInstance().newDuration(string_value());
-				Duration mdduration = DatatypeFactory.newInstance().newDuration(md.string_value());
-				double thistime = thisDuration.getTimeInMillis(Calendar.getInstance());
-				double thattime = mdduration.getTimeInMillis(Calendar.getInstance());
-				res = BigDecimal.valueOf(thistime);
-				BigDecimal l = BigDecimal.valueOf(thattime);
-				res = res.divide(l, 18, RoundingMode.HALF_EVEN);
-			} catch (DatatypeConfigurationException ex) {
-				
-			}
-
-//			double res = value() / md.value();
+			res = new BigDecimal(this.value());
+			BigDecimal l = new BigDecimal(md.value());
+			res = res.divide(l, 18, BigDecimal.ROUND_HALF_EVEN);
 
 			return ResultSequenceFactory.create_new(new XSDecimal(res));
 		} else {
@@ -393,5 +386,9 @@
 			return null; // unreach
 		}
 	}
-	
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_DAYTIMEDURATION;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDecimal.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDecimal.java
index 4207bd1..eaa0411 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDecimal.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDecimal.java
@@ -20,15 +20,19 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.Iterator;
 
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+
 /**
  * A representation of the Decimal datatype
  */
@@ -83,7 +87,7 @@
 	 * 
 	 * @return String representation of the Decimal value stored
 	 */
-	public String string_value() {
+	public String getStringValue() {
 		
 		if (zero()) {
 			return "0";
@@ -114,12 +118,10 @@
 	 * @return A new result sequence consisting of the decimal number supplied.
 	 */
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 		
 		if (aat instanceof XSDuration || aat instanceof CalendarType ||
 			aat instanceof XSBase64Binary || aat instanceof XSHexBinary ||
@@ -127,11 +129,11 @@
 			throw DynamicError.invalidType();
 		}
 		
-		if (aat.string_value().indexOf("-INF") != -1) {
+		if (aat.getStringValue().indexOf("-INF") != -1) {
 			throw DynamicError.cant_cast(null);
 		}
 		
-		if (!isLexicalValue(aat.string_value())) {
+		if (!isLexicalValue(aat.getStringValue())) {
 			throw DynamicError.invalidLexicalValue();
 		}
 		
@@ -142,10 +144,7 @@
 		try {
 			// XPath doesn't allow for converting Exponents to Decimal values.
 			
-			XSDecimal decimal = castDecimal(aat);
-			
-			rs.add(decimal);
-			return rs;
+			return castDecimal(aat);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
@@ -162,13 +161,14 @@
 		}
 		return true;
 	}
-	private boolean isCastable(AnyType aat) throws DynamicError {
+	
+	private boolean isCastable(Item aat) throws DynamicError {
 		if (aat instanceof XSBoolean || aat instanceof NumericType) {
 			return true;
 		}		
 		
-		if ((aat.string_value().indexOf("E") != -1) || 
-			(aat.string_value().indexOf("e") != -1)) {
+		if ((aat.getStringValue().indexOf("E") != -1) || 
+			(aat.getStringValue().indexOf("e") != -1)) {
 			return false;
 		}
 
@@ -179,15 +179,15 @@
 		return false;
 	}
 
-	private XSDecimal castDecimal(AnyType aat) {
+	private XSDecimal castDecimal(Item aat) {
 		if (aat instanceof XSBoolean) {
-			if (aat.string_value().equals("true")) {
+			if (aat.getStringValue().equals("true")) {
 				return new XSDecimal(new BigDecimal("1"));
 			} else {
 				return new XSDecimal(new BigDecimal("0"));
 			}
 		}
-		return new XSDecimal(aat.string_value());
+		return new XSDecimal(aat.getStringValue());
 	}
 	
 	/**
@@ -225,7 +225,7 @@
 	 * @return True if the 2 representation represent the same number. False
 	 *         otherwise
 	 */
-	public boolean eq(AnyType at, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType at, DynamicContext dynamicContext) throws DynamicError {
 		XSDecimal dt = null;
 		if (!(at instanceof XSDecimal)) { 
 			ResultSequence rs = ResultSequenceFactory.create_new(at);
@@ -235,7 +235,7 @@
 				throw DynamicError.throw_type_error();
 			}
 		
-			AnyType cat = crs.first();
+			Item cat = crs.first();
 
 			dt = (XSDecimal) cat;
 	    } else {
@@ -254,16 +254,16 @@
 	 *         one stored. False otherwise
 	 */
 	public boolean gt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
 		
 		XSDecimal val = (XSDecimal) get_single_type(carg, XSDecimal.class);
 		return (_value.compareTo(val.getValue()) == 1);
 	}
 
-	protected AnyType convertArg(AnyType arg) throws DynamicError {
+	protected Item convertArg(AnyType arg) throws DynamicError {
 		ResultSequence rs = ResultSequenceFactory.create_new(arg);
 		rs = constructor(rs);
-		AnyType carg = rs.first();
+		Item carg = rs.first();
 		return carg;
 	}
 	
@@ -277,7 +277,7 @@
 	 *         one stored. False otherwise
 	 */
 	public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
 		XSDecimal val = (XSDecimal) get_single_type(carg, XSDecimal.class);
 		return (_value.compareTo(val.getValue()) == -1);
 	}
@@ -296,7 +296,7 @@
 	public ResultSequence plus(ResultSequence arg) throws DynamicError {
 		// get arg
 		ResultSequence carg = convertResultSequence(arg);
-		AnyType at = get_single_arg(carg);
+		Item at = get_single_arg(carg);
 		if (!(at instanceof XSDecimal))
 			DynamicError.throw_type_error();
 		XSDecimal dt = (XSDecimal) at;
@@ -333,7 +333,7 @@
 		
 		ResultSequence carg = convertResultSequence(arg);
 
-		AnyType at = get_single_arg(carg);
+		Item at = get_single_arg(carg);
 		if (!(at instanceof XSDecimal))
 			DynamicError.throw_type_error();
 		XSDecimal dt = (XSDecimal) at;
@@ -350,7 +350,7 @@
 	 * @return A XSDecimal consisting of the result of the mathematical
 	 *         multiplication.
 	 */
-	public ResultSequence times(ResultSequence arg) throws DynamicError {
+	public ResultSequence times(ResultSequence arg) {
 		ResultSequence carg = convertResultSequence(arg);
 
 		XSDecimal val = (XSDecimal) get_single_type(carg, XSDecimal.class);
@@ -503,4 +503,14 @@
 		BigDecimal round = _value.setScale(precision, BigDecimal.ROUND_HALF_EVEN);
 		return new XSDecimal(round);
 	}
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_DECIMAL;
+	}
+
+	@Override
+	public Object getNativeValue() {
+		return _value;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDouble.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDouble.java
index 1de1292..1aaf2c8 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDouble.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDouble.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,18 +13,22 @@
  *     David Carver (STAR) - bug 262765 - various numeric formatting fixes and calculations
  *     David Carver (STAR) - bug 262765 - fixed rounding errors.      
  *     Jesper Steen Moller - Bug 286062 - Fix idiv error cases and increase precision  
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the Double datatype
@@ -62,9 +66,9 @@
 	public XSDouble(String init) throws DynamicError {
 		try {
 			if (init.equals("-INF")) {
-				_value = Double.NEGATIVE_INFINITY;
+				_value = new Double(Double.NEGATIVE_INFINITY);
 			} else if (init.equals("INF")) {
-				_value = Double.POSITIVE_INFINITY;
+				_value = new Double(Double.POSITIVE_INFINITY);
 			} else {
 				_value = new Double(init);
 			}
@@ -84,9 +88,9 @@
 		try {
 			Double d = null;
 			if (i.equals("INF")) {
-				d = Double.POSITIVE_INFINITY;
+				d = new Double(Double.POSITIVE_INFINITY);
 			} else if (i.equals("-INF")) {
-				d = Double.NEGATIVE_INFINITY;
+				d = new Double(Double.NEGATIVE_INFINITY);
 			} else {
 				d = new Double(i);
 			}
@@ -105,14 +109,12 @@
 	 * @throws DynamicError
 	 * @return A new result sequence consisting of the double number supplied.
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		if (aat instanceof XSDuration || aat instanceof CalendarType ||
 			aat instanceof XSBase64Binary || aat instanceof XSHexBinary ||
@@ -129,11 +131,10 @@
 		if (d == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(d);
-		return rs;
+		return d;
 	}
 	
-	private boolean isCastable(AnyType aat) {
+	private boolean isCastable(Item aat) {
 		if (aat instanceof XSString || aat instanceof XSUntypedAtomic ||
 			aat instanceof NodeType) {
 			return true;
@@ -144,15 +145,15 @@
 		return false;
 	}
 	
-	private XSDouble castDouble(AnyType aat) {
+	private XSDouble castDouble(Item aat) {
 		if (aat instanceof XSBoolean) {
-			if (aat.string_value().equals("true")) {
-				return new XSDouble(new Double("1.0E0"));
+			if (aat.getStringValue().equals("true")) {
+				return new XSDouble(1.0E0);
 			} else {
-				return new XSDouble(new Double("0.0E0"));
+				return new XSDouble(0.0E0);
 			}
 		}
-		return parse_double(aat.string_value());
+		return parse_double(aat.getStringValue());
 		
 	}
 
@@ -161,7 +162,6 @@
 	 * 
 	 * @return "xs:double" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_DOUBLE;
 	}
@@ -171,7 +171,6 @@
 	 * 
 	 * @return "double" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "double";
 	}
@@ -181,8 +180,7 @@
 	 * 
 	 * @return String representation of the Decimal value stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		if (zero()) {
 			return "0";
 		}
@@ -204,7 +202,7 @@
 	 * @return True if this XSDouble represents NaN. False otherwise.
 	 */
 	public boolean nan() {
-		return Double.isNaN(_value);
+		return Double.isNaN(_value.doubleValue());
 	}
 
 	/**
@@ -213,7 +211,7 @@
 	 * @return True if this XSDouble represents infinity. False otherwise.
 	 */
 	public boolean infinite() {
-		return Double.isInfinite(_value);
+		return Double.isInfinite(_value.doubleValue());
 	}
 
 	/**
@@ -221,9 +219,8 @@
 	 * 
 	 * @return True if this XSDouble represents 0. False otherwise.
 	 */
-	@Override
 	public boolean zero() {
-		return (Double.compare(_value, 0.0E0) == 0);
+		return (Double.compare(_value.doubleValue(), 0.0E0) == 0);
 	}
 
 	/*
@@ -234,7 +231,7 @@
 	 * @since 1.1
 	 */
 	public boolean negativeZero() {
-		return (Double.compare(_value, -0.0E0) == 0);
+		return (Double.compare(_value.doubleValue(), -0.0E0) == 0);
 	}
 
 	/**
@@ -256,14 +253,14 @@
 	 *         otherwise
 	 * @since 1.1
 	 */
-	public boolean eq(AnyType aa, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType aa, DynamicContext dynamicContext) throws DynamicError {
 		ResultSequence rs = ResultSequenceFactory.create_new(aa);
 		ResultSequence crs = constructor(rs);
 		
 		if (crs.empty()) {
 			throw DynamicError.throw_type_error();
 		}
-		AnyType cat = crs.first();
+		Item cat = crs.first();
 
 		XSDouble d = (XSDouble) cat;
 		if (d.nan() && nan()) {
@@ -286,16 +283,16 @@
 	 *         one stored. False otherwise
 	 */
 	public boolean gt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
 		
 		XSDouble val = (XSDouble) get_single_type(carg, XSDouble.class);
 		return double_value() > val.double_value();
 	}
 
-	protected AnyType convertArg(AnyType arg) throws DynamicError {
+	protected Item convertArg(AnyType arg) throws DynamicError {
 		ResultSequence rs = ResultSequenceFactory.create_new(arg);
 		rs = constructor(rs);
-		AnyType carg = rs.first();
+		Item carg = rs.first();
 		return carg;
 	}
 
@@ -311,7 +308,7 @@
 	 *         one stored. False otherwise
 	 */
 	public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
 
 		XSDouble val = (XSDouble) get_single_type(carg, XSDouble.class);
 		return double_value() < val.double_value();
@@ -328,7 +325,7 @@
 	 */
 	public ResultSequence plus(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = convertResultSequence(arg);
-		AnyType at = get_single_arg(carg);
+		Item at = get_single_arg(carg);
 		
 		if (!(at instanceof XSDouble))
 			DynamicError.throw_type_error();
@@ -429,7 +426,7 @@
 		if (val.zero())
 			throw DynamicError.div_zero(null);
 
-		BigDecimal result = BigDecimal.valueOf((double_value() / val.double_value()));
+		BigDecimal result = new BigDecimal((double_value() / val.double_value()));
 		return ResultSequenceFactory.create_new(new XSInteger(result.toBigInteger()));
 	}
 
@@ -454,7 +451,6 @@
 	 * 
 	 * @return A XSDouble representing the negation of this XSDecimal
 	 */
-	@Override
 	public ResultSequence unary_minus() {
 		return ResultSequenceFactory.create_new(new XSDouble(-1
 				* double_value()));
@@ -466,7 +462,6 @@
 	 * 
 	 * @return A XSDouble representing the absolute value of the number stored
 	 */
-	@Override
 	public NumericType abs() {
 		return new XSDouble(Math.abs(double_value()));
 	}
@@ -477,7 +472,6 @@
 	 * @return A XSDouble representing the smallest integer greater than the
 	 *         number stored
 	 */
-	@Override
 	public NumericType ceiling() {
 		return new XSDouble(Math.ceil(double_value()));
 	}
@@ -488,7 +482,6 @@
 	 * @return A XSDouble representing the largest integer smaller than the
 	 *         number stored
 	 */
-	@Override
 	public NumericType floor() {
 		return new XSDouble(Math.floor(double_value()));
 	}
@@ -498,10 +491,9 @@
 	 * 
 	 * @return A XSDouble representing the closest long of the number stored.
 	 */
-	@Override
 	public NumericType round() {
-		BigDecimal value = new BigDecimal(_value);
-		BigDecimal round = value.setScale(0, RoundingMode.HALF_UP);
+		BigDecimal value = new BigDecimal(_value.doubleValue());
+		BigDecimal round = value.setScale(0, BigDecimal.ROUND_HALF_UP);
 		return new XSDouble(round.doubleValue());
 	}
 
@@ -510,7 +502,6 @@
 	 * 
 	 * @return A XSDouble representing the closest long of the number stored.
 	 */
-	@Override
 	public NumericType round_half_to_even() {
 
 		return round_half_to_even(0);
@@ -524,10 +515,17 @@
 	 *            An integer precision
 	 * @return A XSDouble representing the closest long of the number stored.
 	 */
-	@Override
 	public NumericType round_half_to_even(int precision) {
-		BigDecimal value = new BigDecimal(_value);
-		BigDecimal round = value.setScale(precision, RoundingMode.HALF_EVEN);
+		BigDecimal value = new BigDecimal(_value.doubleValue());
+		BigDecimal round = value.setScale(precision, BigDecimal.ROUND_HALF_EVEN);
 		return new XSDouble(round.doubleValue());
 	}
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_DOUBLE;
+	}
+
+    public Object getNativeValue() {
+    	return double_value();
+    }
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDuration.java
index 20b1dba..bd3a1fd 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,17 +8,20 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver (STAR) - bug 282223 - Implemented XSDuration type for castable checking.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the xs:duration data type. Other duration implementations
@@ -110,12 +113,10 @@
 		this(0, 0, 0, 0, 0, 0.0, false);
 	}
 
-	@Override
 	public String type_name() {
 		return "duration";
 	}
 
-	@Override
 	public String string_type() {
 		return XS_DURATION;
 	}
@@ -125,8 +126,7 @@
 	 * 
 	 * @return String representation of the duration stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "";
 		boolean did_something = false;
 		String tret = "";
@@ -164,7 +164,7 @@
 			did_something = true;
 		}
 		if (seconds != 0) {
-			String doubStr = (Double.valueOf(seconds).toString());
+			String doubStr = (new Double(seconds).toString());
 			if (doubStr.endsWith(".0")) {
 				// string value of x.0 seconds is xS. e.g, 7.0S is converted to
 				// 7S.
@@ -232,7 +232,7 @@
 	 * @return True if they both represent the duration of time. False otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSDuration val = (XSDuration) NumericType.get_single_type(arg,
 				XSDuration.class);
 
@@ -322,12 +322,9 @@
 	 * @return New ResultSequence consisting of the time duration extracted
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		
@@ -346,9 +343,7 @@
 		if (duration == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(duration);
-
-		return rs;
+		return duration;
 	}
 
 	private XSDuration castDuration(AnyAtomicType aat) {
@@ -357,7 +352,7 @@
 			return new XSDuration(duration.year(), duration.month(), duration.days(), duration.hours(), duration.minutes(), duration.seconds(), duration.negative());
 		}
 		
-		return parseDTDuration(aat.string_value());
+		return parseDTDuration(aat.getStringValue());
 	}
 	/**
 	 * Creates a new XSDayTimeDuration by parsing the supplied String
@@ -467,7 +462,6 @@
 				negative);
 	}
 
-	@Override
 	public Object clone() throws CloneNotSupportedException {
 		return new XSDuration(year(), month(), days(), hours(), minutes(),
 				seconds(), negative());
@@ -492,7 +486,7 @@
 	}
 
 	protected boolean isCastable(AnyAtomicType aat) {
-		String value = aat.string_value(); // get this once so we don't recreate everytime.
+		String value = aat.getStringValue(); // get this once so we don't recreate everytime.
 		String type = aat.string_type();
 		if (type.equals("xs:string") || type.equals("xs:untypedAtomic")) {
 			if (isDurationValue(value)) {
@@ -511,5 +505,13 @@
 	private boolean isDurationValue(String value) {
 		return value.startsWith("P") || value.startsWith("-P");
 	}
+	
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_DURATION;
+	}
+
+	public Object getNativeValue() {
+		return _datatypeFactory.newDuration(! negative(), year(), month(), days(), hours(), minutes(), (int)seconds());
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSEntity.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSEntity.java
index a2bca50..19879f5 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSEntity.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSEntity.java
@@ -13,9 +13,11 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * Built in Data Type for xs:Entity
@@ -35,12 +37,10 @@
 		super(value);
 	}
 	
-	@Override
 	public String string_type() {
 		return XS_ENTITY;
 	}
 	
-	@Override
 	public String type_name() {
 		return "ENTITY";
 	}
@@ -57,25 +57,24 @@
 	 * @return New ResultSequence consisting of the ENTITY supplied
 	 * @throws DynamicError
 	 */
-
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
-		String strValue = aat.string_value();
+		String strValue = aat.getStringValue();
 		
 		if (!isConstraintSatisfied(strValue)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 
-		rs.add(new XSEntity(strValue));
-
-		return rs;
-
+		return new XSEntity(strValue);
 	}
+	
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_ENTITY;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSFloat.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSFloat.java
index be9f367..2ba81d7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSFloat.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSFloat.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,18 +13,22 @@
  *     David Carver - bug 282223 - fixed casting errors.
  *     Jesper Steen Moller - Bug 286062 - Fix idiv error cases and increase precision  
  *     Jesper Steen Moller - bug 281028 - Added constructor from string
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the Float datatype
@@ -41,7 +45,7 @@
 	 *            The number to be stored
 	 */
 	public XSFloat(float x) {
-		_value = x;
+		_value = new Float(x);
 	}
 
 	/**
@@ -60,9 +64,9 @@
 	public XSFloat(String init) throws DynamicError {
 		try {
 			if (init.equals("-INF")) {
-				_value = Float.NEGATIVE_INFINITY;
+				_value = new Float(Float.NEGATIVE_INFINITY);
 			} else if (init.equals("INF")) {
-				_value = Float.POSITIVE_INFINITY;
+				_value = new Float(Float.POSITIVE_INFINITY);
 			} else {
 				_value = new Float(init);
 			}
@@ -75,7 +79,6 @@
 	 * 
 	 * @return "xs:float" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_FLOAT;
 	}
@@ -85,7 +88,6 @@
 	 * 
 	 * @return "float" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "float";
 	}
@@ -95,8 +97,7 @@
 	 * 
 	 * @return String representation of the stored number
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		if (zero()) {
 		   return "0";
 		}
@@ -117,7 +118,7 @@
 	 * @return True is this datatype represents NaN. False otherwise
 	 */
 	public boolean nan() {
-		return Float.isNaN(_value);
+		return Float.isNaN(_value.floatValue());
 	}
 
 	/**
@@ -126,7 +127,7 @@
 	 * @return True is this datatype represents infinity. False otherwise
 	 */
 	public boolean infinite() {
-		return Float.isInfinite(_value);
+		return Float.isInfinite(_value.floatValue());
 	}
 
 	/**
@@ -134,9 +135,8 @@
 	 * 
 	 * @return True if this datatype represents 0. False otherwise
 	 */
-	@Override
 	public boolean zero() {
-	   return (Float.compare(_value, 0) == 0);
+	   return (Float.compare(_value.floatValue(), 0) == 0);
 	}
 	
 	/*
@@ -146,7 +146,7 @@
 	 * @since 1.1
 	 */
 	public boolean negativeZero() {
-	   return (Float.compare(_value, -0.0f) == 0);
+	   return (Float.compare(_value.floatValue(), -0.0f) == 0);
 	}
 	
 	/**
@@ -158,14 +158,11 @@
 	 * @return New ResultSequence consisting of the float supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
-		AnyType aat = arg.first();
+		AnyType aat = (AnyType) arg.first();
 		
 		if (aat instanceof XSDuration || aat instanceof CalendarType ||
 			aat instanceof XSBase64Binary || aat instanceof XSHexBinary ||
@@ -182,22 +179,21 @@
 		
 
 		try {
-			Float f = null;
-			if (aat.string_value().equals("INF")) {
+			float f;
+			if (aat.getStringValue().equals("INF")) {
 				f = Float.POSITIVE_INFINITY;
-			} else if (aat.string_value().equals("-INF")) {
+			} else if (aat.getStringValue().equals("-INF")) {
 				f = Float.NEGATIVE_INFINITY;
 			} else if (aat instanceof XSBoolean) {
-				if (aat.string_value().equals("true")) {
-					f = new Float("1.0E0");
+				if (aat.getStringValue().equals("true")) {
+					f = 1.0f;
 				} else {
-					f = new Float("0.0E0");
+					f = 0.0f;
 				}
 			} else {
-			    f = new Float(aat.string_value());
+			    f = Float.valueOf(aat.getStringValue());
 			}
-			rs.add(new XSFloat(f.floatValue()));
-			return rs;
+			return new XSFloat(f);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
@@ -210,7 +206,7 @@
 	 * @return The actual float value stored
 	 */
 	public float float_value() {
-		return _value;
+		return _value.floatValue();
 	}
 
 	/**
@@ -222,8 +218,8 @@
 	 *         otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType aa, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(aa);
+	public boolean eq(AnyType aa, DynamicContext dynamicContext) throws DynamicError {
+		Item carg = convertArg(aa);
 		if (!(carg instanceof XSFloat))
 			DynamicError.throw_type_error();
 
@@ -248,7 +244,7 @@
 	 * @throws DynamicError
 	 */
 	public boolean gt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
 		XSFloat val = (XSFloat) get_single_type(carg, XSFloat.class);
 		return float_value() > val.float_value();
 	}
@@ -263,7 +259,7 @@
 	 * @throws DynamicError
 	 */
 	public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
 		XSFloat val = (XSFloat) get_single_type(carg, XSFloat.class);
 		return float_value() < val.float_value();
 	}
@@ -278,7 +274,7 @@
 	 */
 	public ResultSequence plus(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = convertResultSequence(arg);
-		AnyType at = get_single_arg(carg);
+		Item at = get_single_arg(carg);
 		if (!(at instanceof XSFloat))
 			DynamicError.throw_type_error();
 		XSFloat val = (XSFloat) at;
@@ -298,7 +294,7 @@
 	 */
 	public ResultSequence minus(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = constructor(arg);
-		AnyType at = get_single_arg(carg);
+		Item at = get_single_arg(carg);
 		if (!(at instanceof XSFloat))
 			DynamicError.throw_type_error();
 		XSFloat val = (XSFloat) at;
@@ -360,7 +356,8 @@
 		if (val.zero())
 			throw DynamicError.div_zero(null);
 
-		BigDecimal result = BigDecimal.valueOf((float_value() / val.float_value()));
+		BigDecimal result = BigDecimal.valueOf((new Float((float_value() / 
+				                                 val.float_value()))).longValue());
 		return ResultSequenceFactory.create_new(new XSInteger(result.toBigInteger()));
 	}
 
@@ -385,7 +382,6 @@
 	 * 
 	 * @return A XSFloat representing the negation of the number stored
 	 */
-	@Override
 	public ResultSequence unary_minus() {
 		return ResultSequenceFactory
 				.create_new(new XSFloat(-1 * float_value()));
@@ -396,7 +392,6 @@
 	 * 
 	 * @return A XSFloat representing the absolute value of the number stored
 	 */
-	@Override
 	public NumericType abs() {
 		return new XSFloat(Math.abs(float_value()));
 	}
@@ -407,7 +402,6 @@
 	 * @return A XSFloat representing the smallest integer greater than the
 	 *         number stored
 	 */
-	@Override
 	public NumericType ceiling() {
 		return new XSFloat((float) Math.ceil(float_value()));
 	}
@@ -418,7 +412,6 @@
 	 * @return A XSFloat representing the largest integer smaller than the
 	 *         number stored
 	 */
-	@Override
 	public NumericType floor() {
 		return new XSFloat((float) Math.floor(float_value()));
 	}
@@ -428,10 +421,9 @@
 	 * 
 	 * @return A XSFloat representing the closest long of the number stored.
 	 */
-	@Override
 	public NumericType round() {
 		BigDecimal value = new BigDecimal(float_value());
-		BigDecimal round = value.setScale(0, RoundingMode.HALF_UP);
+		BigDecimal round = value.setScale(0, BigDecimal.ROUND_HALF_UP);
 		return new XSFloat(round.floatValue());
 	}
 
@@ -440,7 +432,6 @@
 	 * 
 	 * @return A XSFloat representing the closest long of the number stored.
 	 */
-	@Override
 	public NumericType round_half_to_even() {
 		return round_half_to_even(0);
 	}
@@ -451,18 +442,16 @@
 	 * @param precision An integer precision 
 	 * @return A XSFloat representing the closest long of the number stored.
 	 */
-
-	@Override
 	public NumericType round_half_to_even(int precision) {
-		BigDecimal value = new BigDecimal(_value);
-		BigDecimal round = value.setScale(precision, RoundingMode.HALF_EVEN);
+		BigDecimal value = new BigDecimal(_value.floatValue());
+		BigDecimal round = value.setScale(precision, BigDecimal.ROUND_HALF_EVEN);
 		return new XSFloat(round.floatValue());
 	}
 	
-	protected AnyType convertArg(AnyType arg) throws DynamicError {
+	protected Item convertArg(AnyType arg) throws DynamicError {
 		ResultSequence rs = ResultSequenceFactory.create_new(arg);
 		rs = constructor(rs);
-		AnyType carg = rs.first();
+		Item carg = rs.first();
 		return carg;
 	}
 	
@@ -482,4 +471,11 @@
 		return carg;
 	}	
 	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_FLOAT;
+	}
+	
+	public Object getNativeValue() {
+		return float_value();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGDay.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGDay.java
index 50d6872..92c9646 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGDay.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGDay.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,17 +10,22 @@
  *     David Carver (STAR) - bug 262765 - Correct parsing of Date to get day correctly.
  *     David Carver (STAR) - bug 282223 - fixed issue with casting.
  *     David Carver - bug 280547 - fix dates for comparison 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the Day datatype
@@ -60,7 +65,6 @@
 	 * 
 	 * @return "gDay" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "gDay";
 	}
@@ -95,7 +99,7 @@
 			}
 			
 			String[] split = str.split("-");
-			startdate += split[3].replace("Z", "");
+			startdate += split[3].replaceAll("Z", "");
 			
 			if (str.indexOf('T') != -1) {
 				if (split.length > 4) {
@@ -140,12 +144,9 @@
 	 * @return New ResultSequence consisting of the supplied day
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration ||
@@ -164,9 +165,7 @@
 		if (val == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(val);
-
-		return rs;
+		return val;
 	}
 	
 	private boolean isCastable(AnyAtomicType aat) {
@@ -213,7 +212,7 @@
 			XSDateTime dateTime = (XSDateTime) aat;
 			return new XSGDay(dateTime.calendar(), dateTime.tz());
 		}
-		return parse_gDay(aat.string_value()); 
+		return parse_gDay(aat.getStringValue()); 
 	}
 
 	/**
@@ -239,8 +238,7 @@
 	 * 
 	 * @return String representation of the stored day
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "---";
 
 		Calendar adjustFortimezone = calendar();
@@ -278,7 +276,6 @@
 	 * 
 	 * @return "xs:gDay" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_G_DAY;
 	}
@@ -302,7 +299,7 @@
 	 *         otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSGDay val = (XSGDay) NumericType.get_single_type(arg, XSGDay.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
 		Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());
@@ -319,5 +316,9 @@
 	public XSDuration tz() {
 		return _tz;
 	}	
-	
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_GDAY;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonth.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonth.java
index 97d83c1..e6c10e7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonth.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonth.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,22 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver (STAR) - bug 262765 - Fixed parsing of gMonth values
  *     David Carver - bug 280547 - fix dates for comparison 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the gMonth datatype
@@ -59,7 +64,6 @@
 	 * 
 	 * @return "gMonth" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "gMonth";
 	}
@@ -92,7 +96,7 @@
 			}
 			
 			String[] split = str.split("-");
-			startdate += split[2].replace("Z", "") + "-01";
+			startdate += split[2].replaceAll("Z", "") + "-01";
 			
 			if (str.indexOf('T') != -1) { 
 				if (split.length > 3) {
@@ -136,12 +140,9 @@
 	 * @return New ResultSequence consisting of the supplied month
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration || 
@@ -160,9 +161,7 @@
 		if (val == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(val);
-
-		return rs;
+		return val;
 	}
 
 	protected boolean isGDataType(AnyAtomicType aat) {
@@ -209,7 +208,7 @@
 			return new XSGMonth(dateTime.calendar(), dateTime.tz());
 		}
 		
-		return parse_gMonth(aat.string_value());
+		return parse_gMonth(aat.getStringValue());
 	}
 	
 	/**
@@ -235,8 +234,7 @@
 	 * 
 	 * @return String representation of the stored month
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "--";
 
 		ret += XSDateTime.pad_int(month(), 2);
@@ -273,7 +271,6 @@
 	 * 
 	 * @return "xs:gMonth" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_G_MONTH;
 	}
@@ -297,7 +294,7 @@
 	 *         otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSGMonth val = (XSGMonth) NumericType.get_single_type(arg,
 				XSGMonth.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
@@ -315,5 +312,8 @@
 	public XSDuration tz() {
 		return _tz;
 	}	
-	
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_GMONTH;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonthDay.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonthDay.java
index f2233b9..7cb107e 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonthDay.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGMonthDay.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,17 +11,22 @@
  *     David Carver (STAR) - bug 282223 - fix timezone adjustment creation.
  *                                        fixed casting issue.
  *     David Carver - bug 280547 - fix dates for comparison 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the MonthDay datatype
@@ -62,7 +67,6 @@
 	 * 
 	 * @return "gMonthDay" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "gMonthDay";
 	}
@@ -99,7 +103,7 @@
 
 			
 			String[] split = str.split("-");
-			startdate += split[2].replace("Z", "") + "-" + split[3].replace("Z", "").substring(0, 2);
+			startdate += split[2].replaceAll("Z", "") + "-" + split[3].replaceAll("Z", "").substring(0, 2);
 			
 			if (split.length > 4) {
 				String[] timesplit = split[4].split(":");
@@ -143,12 +147,9 @@
 	 * @return New ResultSequence consisting of the supplied month and day
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration || 
@@ -167,9 +168,7 @@
 		if (val == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(val);
-
-		return rs;
+		return val;
 	}
 
 	protected boolean isGDataType(AnyAtomicType aat) {
@@ -216,7 +215,7 @@
 			return new XSGMonthDay(dateTime.calendar(), dateTime.tz());
 		}
 		
-		return parse_gMonthDay(aat.string_value());
+		return parse_gMonthDay(aat.getStringValue());
 	}
 	
 	/**
@@ -251,8 +250,7 @@
 	 * 
 	 * @return String representation of the stored month and day
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "--";
 
 		Calendar adjustFortimezone = calendar();
@@ -294,7 +292,6 @@
 	 * 
 	 * @return "xs:gMonthDay" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_G_MONTH_DAY;
 	}
@@ -318,7 +315,7 @@
 	 *         False otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSGMonthDay val = (XSGMonthDay) NumericType.get_single_type(arg,
 				XSGMonthDay.class);
 
@@ -334,4 +331,7 @@
 		return _tz;
 	}	
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_GMONTHDAY;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYear.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYear.java
index 9386d27..ce70de2 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYear.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYear.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,22 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver (STAR) - bug 282223 - fix casting issues. 
  *     David Carver - bug 280547 - fix dates for comparison 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the gMonth datatype
@@ -61,7 +66,6 @@
 	 * 
 	 * @return "gYear" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "gYear";
 	}
@@ -110,12 +114,9 @@
 	 * @return New ResultSequence consisting of the supplied year
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration ||
@@ -134,9 +135,7 @@
 		if (val == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(val);
-
-		return rs;
+		return val;
 	}
 	
 	protected boolean isGDataType(AnyAtomicType aat) {
@@ -183,7 +182,7 @@
 			return new XSGYear(dateTime.calendar(), dateTime.tz());
 		}
 		
-		return parse_gYear(aat.string_value());
+		return parse_gYear(aat.getStringValue());
 	}
 
 	/**
@@ -213,8 +212,7 @@
 	 * 
 	 * @return String representation of the stored year
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "";
 
 		ret += XSDateTime.pad_int(year(), 4);
@@ -251,7 +249,6 @@
 	 * 
 	 * @return "xs:gYear" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_G_YEAR;
 	}
@@ -275,7 +272,7 @@
 	 *         otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSGYear val = (XSGYear) NumericType.get_single_type(arg, XSGYear.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
 		Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());
@@ -291,4 +288,8 @@
 	public XSDuration tz() {
 		return _tz;
 	}	
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_GYEAR;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYearMonth.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYearMonth.java
index ef11419..06fe388 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYearMonth.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSGYearMonth.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,17 +9,22 @@
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver (STAR) - bug 282223 - fixed casting issues. 
  *     David Carver - bug 280547 - fix dates for comparison 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the YearMonth datatype
@@ -60,7 +65,6 @@
 	 * 
 	 * @return "gYearMonth" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "gYearMonth";
 	}
@@ -113,12 +117,9 @@
 	 * @return New ResultSequence consisting of the supplied year and month
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration ||
@@ -137,9 +138,7 @@
 		if (val == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(val);
-
-		return rs;
+		return val;
 	}
 	
 	protected boolean isGDataType(AnyAtomicType aat) {
@@ -195,7 +194,7 @@
 			return new XSGYearMonth(dateTime.calendar(), dateTime.tz());
 		}
 		
-		return parse_gYearMonth(aat.string_value());
+		return parse_gYearMonth(aat.getStringValue());
 	}
 
 	/**
@@ -234,8 +233,7 @@
 	 * 
 	 * @return String representation of the stored year and month
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "";
 
 		ret += XSDateTime.pad_int(year(), 4);
@@ -275,7 +273,6 @@
 	 * 
 	 * @return "xs:gYearMonth" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_G_YEAR_MONTH;
 	}
@@ -299,7 +296,7 @@
 	 *         False otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSGYearMonth val = (XSGYearMonth) NumericType.get_single_type(arg,
 				XSGYearMonth.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
@@ -315,6 +312,9 @@
 	 */
 	public XSDuration tz() {
 		return _tz;
-	}	
+	}
 	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_GYEARMONTH;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSHexBinary.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSHexBinary.java
index 05b0e2d..b82b9c3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSHexBinary.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSHexBinary.java
@@ -8,17 +8,20 @@
  * Contributors:
  *     Mukul Gandhi - bug 281054 - initial API and implementation
  *     David Carver (STAR) - bug 228223 - fixed casting issue.  Needed to encode the value. 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import org.apache.xerces.impl.dv.util.Base64;
 import org.apache.xerces.impl.dv.util.HexBin;
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the xs:hexBinary datatype
@@ -50,7 +53,6 @@
 	 * 
 	 * @return "xs:hexBinary" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_HEX_BINARY;
 	}
@@ -60,7 +62,6 @@
 	 * 
 	 * @return "hexBinary" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "hexBinary";
 	}
@@ -71,8 +72,7 @@
 	 * 
 	 * @return The hexBinary stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value.toUpperCase();
 	}
 
@@ -94,12 +94,9 @@
 	 * @return New ResultSequence representing hexBinary value 
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof XSDuration ||
@@ -108,7 +105,7 @@
 			throw DynamicError.invalidType();
 		}
 
-		String str_value = aat.string_value();
+		String str_value = aat.getStringValue();
 		
 		if (!(aat instanceof XSHexBinary ||
 				  aat instanceof XSString ||
@@ -148,18 +145,14 @@
  		}
 		
 		if (decodedValue != null) {
-		  rs.add(new XSHexBinary(new String(decodedValue)));
+		  return new XSHexBinary(new String(decodedValue));
 		}
 		else {
 		  // invalid hexBinary string
 		  throw DynamicError.throw_type_error();	
 		}
-
-		return rs;
 	}
 
-
-
 	/**
 	 * Equality comparison between this and the supplied representation which
 	 * must be of type hexBinary
@@ -170,8 +163,8 @@
 	 *         
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
-      String valToCompare = arg.string_value();
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
+      String valToCompare = arg.getStringValue();
       
       byte[] value1 = HexBin.decode(_value);
       byte[] value2 = HexBin.decode(valToCompare);
@@ -192,5 +185,11 @@
       
       return true;
 	}
-
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_HEXBINARY;
+	}
+	
+	public Object getNativeValue() {
+		return HexBin.decode(_value);
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSID.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSID.java
index e8fd900..e5f0431 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSID.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSID.java
@@ -12,9 +12,11 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /*
  * Implements the xs:ID data type.
@@ -33,34 +35,32 @@
 		super();
 	}
 
-	@Override
 	public String string_type() {
 		return XS_ID;
 	}
 	
-	@Override
 	public String type_name() {
 		return "ID";
 	}
 	
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
-		String strValue = aat.string_value();
+		String strValue = aat.getStringValue();
 		
 		if (!isConstraintSatisfied(strValue)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 
-		rs.add(new XSID(strValue));
-
-		return rs;
+		return new XSID(strValue);
 	}
+	
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_ID;
+	}
+	
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSIDREF.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSIDREF.java
index 387a7ab..956167b 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSIDREF.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSIDREF.java
@@ -12,9 +12,11 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /*
  * Implements the xs:IDREF data type.
@@ -33,34 +35,31 @@
 		super();
 	}
 
-	@Override
 	public String string_type() {
 		return XS_IDREF;
 	}
 	
-	@Override
 	public String type_name() {
 		return "IDREF";
 	}
 	
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
-		String strValue = aat.string_value();
+		String strValue = aat.getStringValue();
 		
 		if (!isConstraintSatisfied(strValue)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 
-		rs.add(new XSIDREF(strValue));
-
-		return rs;
+		return new XSIDREF(strValue);
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_IDREF;
+	}
+	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInt.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInt.java
index 5c1fe03..0a06a84 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInt.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInt.java
@@ -1,102 +1,105 @@
-/*******************************************************************************

- * Copyright (c) 2009 Mukul Gandhi, and others

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *     Mukul Gandhi - bug 275105 - implementation of xs:int data type

- *******************************************************************************/

-

-package org.eclipse.wst.xml.xpath2.processor.internal.types;

-

-import java.math.BigInteger;

-

-import org.eclipse.wst.xml.xpath2.processor.DynamicError;

-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;

-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;

-

-public class XSInt extends XSLong {

-	

-	private static final String XS_INT = "xs:int";

-

-	/**

-	 * Initializes a representation of 0

-	 */

-	public XSInt() {

-	  this(BigInteger.valueOf(0));

-	}

-	

-	/**

-	 * Initializes a representation of the supplied int value

-	 * 

-	 * @param x

-	 *            Int to be stored

-	 */

-	public XSInt(BigInteger x) {

-		super(x);

-	}

-	

-	/**

-	 * Retrieves the datatype's full pathname

-	 * 

-	 * @return "xs:int" which is the datatype's full pathname

-	 */

-	@Override

-	public String string_type() {

-		return XS_INT;

-	}

-	

-	/**

-	 * Retrieves the datatype's name

-	 * 

-	 * @return "int" which is the datatype's name

-	 */

-	@Override

-	public String type_name() {

-		return "int";

-	}

-	

-	/**

-	 * Creates a new ResultSequence consisting of the extractable 'int' in the

-	 * supplied ResultSequence

-	 * 

-	 * @param arg

-	 *            The ResultSequence from which the int is to be extracted

-	 * @return New ResultSequence consisting of the 'int' supplied

-	 * @throws DynamicError

-	 */

-	@Override

-	public ResultSequence constructor(ResultSequence arg) throws DynamicError {

-		ResultSequence rs = ResultSequenceFactory.create_new();

-

-		if (arg.empty())

-			return rs;

-

-		// the function conversion rules apply here too. Get the argument

-		// and convert it's string value to an int.

-		AnyType aat = arg.first();

-

-		try {

-			BigInteger bigInt = new BigInteger(aat.string_value());

-			

-			// doing the range checking

-			BigInteger min = BigInteger.valueOf(-2147483648L);

-			BigInteger max = BigInteger.valueOf(2147483647L);			

-

-			if (bigInt.compareTo(min) < 0 || bigInt.compareTo(max) > 0) {

-			   // invalid input

-			   DynamicError.throw_type_error();	

-			}

-			

-			rs.add(new XSInt(bigInt));

-			

-			return rs;

-		} catch (NumberFormatException e) {

-			throw DynamicError.cant_cast(null);

-		}

-

-	}

-	

-}

+/*******************************************************************************
+ * Copyright (c) 2009 Mukul Gandhi, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Mukul Gandhi - bug 275105 - implementation of xs:int data type
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.processor.internal.types;
+
+import java.math.BigInteger;
+
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+
+public class XSInt extends XSLong {
+	
+	private static final String XS_INT = "xs:int";
+
+	/**
+	 * Initializes a representation of 0
+	 */
+	public XSInt() {
+	  this(BigInteger.valueOf(0));
+	}
+	
+	/**
+	 * Initializes a representation of the supplied int value
+	 * 
+	 * @param x
+	 *            Int to be stored
+	 */
+	public XSInt(BigInteger x) {
+		super(x);
+	}
+	
+	/**
+	 * Retrieves the datatype's full pathname
+	 * 
+	 * @return "xs:int" which is the datatype's full pathname
+	 */
+	public String string_type() {
+		return XS_INT;
+	}
+	
+	/**
+	 * Retrieves the datatype's name
+	 * 
+	 * @return "int" which is the datatype's name
+	 */
+	public String type_name() {
+		return "int";
+	}
+	
+	/**
+	 * Creates a new ResultSequence consisting of the extractable 'int' in the
+	 * supplied ResultSequence
+	 * 
+	 * @param arg
+	 *            The ResultSequence from which the int is to be extracted
+	 * @return New ResultSequence consisting of the 'int' supplied
+	 * @throws DynamicError
+	 */
+	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
+
+		if (arg.empty())
+			return ResultBuffer.EMPTY;
+
+		// the function conversion rules apply here too. Get the argument
+		// and convert it's string value to an int.
+		Item aat = arg.first();
+
+		try {
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
+			
+			// doing the range checking
+			BigInteger min = BigInteger.valueOf(-2147483648L);
+			BigInteger max = BigInteger.valueOf(2147483647L);			
+
+			if (bigInt.compareTo(min) < 0 || bigInt.compareTo(max) > 0) {
+			   // invalid input
+			   DynamicError.throw_type_error();	
+			}
+			
+			return new XSInt(bigInt);
+		} catch (NumberFormatException e) {
+			throw DynamicError.cant_cast(null);
+		}
+
+	}
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_INT;
+	}
+	
+
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInteger.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInteger.java
index 6e906c9..d5a724a 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInteger.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSInteger.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,19 +13,23 @@
  *     David Carver (STAR) - bug 282223 - fix casting issues.
  *     Jesper Steen Moller - bug 262765 - fix type tests
  *     Jesper Steen Moller - bug 281028 - Added constructor from string
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.math.RoundingMode;
 import java.util.Iterator;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the Integer datatype
@@ -69,7 +73,6 @@
 	 * 
 	 * @return "xs:integer" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_INTEGER;
 	}
@@ -79,7 +82,6 @@
 	 * 
 	 * @return "integer" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "integer";
 	}
@@ -89,8 +91,7 @@
 	 * 
 	 * @return String representation of the integer stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value.toString();
 	}
 
@@ -99,7 +100,6 @@
 	 * 
 	 * @return True is the integer represented is 0. False otherwise
 	 */
-	@Override
 	public boolean zero() {
 		return (_value.compareTo(BigInteger.ZERO) == 0);
 	}
@@ -113,16 +113,13 @@
 	 * @return New ResultSequence consisting of the integer supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to an integer.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		if (aat instanceof XSDuration || aat instanceof CalendarType ||
 			aat instanceof XSBase64Binary || aat instanceof XSHexBinary ||
@@ -137,17 +134,16 @@
 		
 		try {
 			BigInteger bigInt = castInteger(aat);
-			rs.add(new XSInteger(bigInt));
-			return rs;
+			return new XSInteger(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.invalidLexicalValue();
 		}
 
 	}
 	
-	private BigInteger castInteger(AnyType aat) {
+	private BigInteger castInteger(Item aat) {
 		if (aat instanceof XSBoolean) {
-			if (aat.string_value().equals("true")) {
+			if (aat.getStringValue().equals("true")) {
 				return BigInteger.ONE;
 			} else {
 				return BigInteger.ZERO;
@@ -156,17 +152,17 @@
 		
 		if (aat instanceof XSDecimal || aat instanceof XSFloat ||
 				aat instanceof XSDouble) {
-				BigDecimal bigDec =  new BigDecimal(aat.string_value());
+				BigDecimal bigDec =  new BigDecimal(aat.getStringValue());
 				return bigDec.toBigInteger();
 		}
 		
-		return new BigInteger(aat.string_value());
+		return new BigInteger(aat.getStringValue());
 	}
 	
-	private boolean isCastable(AnyType aat) throws DynamicError {
+	private boolean isCastable(Item aat) throws DynamicError {
 		if (aat instanceof XSString || aat instanceof XSUntypedAtomic ||
 			aat instanceof NodeType) {
-			if (isLexicalValue(aat.string_value())) {
+			if (isLexicalValue(aat.getStringValue())) {
 				return true;
 			} else {
 				return false;
@@ -178,7 +174,6 @@
 		return false;
 	}
 	
-	@Override
 	protected boolean isLexicalValue(String value) {
 		
 		try {
@@ -219,10 +214,9 @@
 	 * @return A XSInteger consisting of the result of the mathematical
 	 *         addition.
 	 */
-	@Override
 	public ResultSequence plus(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = convertResultSequence(arg);
-		AnyType at = get_single_arg(carg);
+		Item at = get_single_arg(carg);
 		if (!(at instanceof XSInteger))
 			DynamicError.throw_type_error();
 		
@@ -258,7 +252,6 @@
 	 * @return A XSInteger consisting of the result of the mathematical
 	 *         subtraction.
 	 */
-	@Override
 	public ResultSequence minus(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = convertResultSequence(arg);
 		XSInteger val = (XSInteger) get_single_type(carg, XSInteger.class);
@@ -276,7 +269,6 @@
 	 * @return A XSInteger consisting of the result of the mathematical
 	 *         multiplication.
 	 */
-	@Override
 	public ResultSequence times(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = convertResultSequence(arg);
 
@@ -294,7 +286,6 @@
 	 *            The ResultSequence to perform a modulus with
 	 * @return A XSInteger consisting of the result of the mathematical modulus.
 	 */
-	@Override
 	public ResultSequence mod(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = convertResultSequence(arg);
 
@@ -309,7 +300,6 @@
 	 * 
 	 * @return New XSInteger representing the negation of the integer stored
 	 */
-	@Override
 	public ResultSequence unary_minus() {
 		return ResultSequenceFactory
 				.create_new(new XSInteger(int_value().multiply(BigInteger.valueOf(-1))));
@@ -320,7 +310,6 @@
 	 * 
 	 * @return New XSInteger representing the absolute of the integer stored
 	 */
-	@Override
 	public NumericType abs() {
 		return new XSInteger(int_value().abs());
 	}
@@ -329,9 +318,8 @@
 	 * (non-Javadoc)
 	 * @see org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal#gt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType)
 	 */
-	@Override
 	public boolean gt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
         XSInteger val = (XSInteger) get_single_type(carg, XSInteger.class);
         
         int compareResult = int_value().compareTo(val.int_value());
@@ -339,11 +327,10 @@
 		return compareResult > 0;
 	}
 	
-	@Override
-	protected AnyType convertArg(AnyType arg) throws DynamicError {
+	protected Item convertArg(AnyType arg) throws DynamicError {
 		ResultSequence rs = ResultSequenceFactory.create_new(arg);
 		rs = constructor(rs);
-		AnyType carg = rs.first();
+		Item carg = rs.first();
 		return carg;
 	}
 	
@@ -351,9 +338,8 @@
 	 * (non-Javadoc)
 	 * @see org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal#lt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType)
 	 */
-	@Override
 	public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
-		AnyType carg = convertArg(arg);
+		Item carg = convertArg(arg);
         XSInteger val = (XSInteger) get_single_type(carg, XSInteger.class);
         
         int compareResult = int_value().compareTo(val.int_value());
@@ -361,7 +347,6 @@
 		return compareResult < 0;
 	}
 	
-	@Override
 	public ResultSequence div(ResultSequence arg) throws DynamicError {
 		ResultSequence carg = convertResultSequence(arg);
 		
@@ -371,8 +356,11 @@
 			throw DynamicError.div_zero(null);
 		}
 		
-		BigDecimal result = getValue().divide(val.getValue(), 18, RoundingMode.HALF_EVEN);
+		BigDecimal result = getValue().divide(val.getValue(), 18, BigDecimal.ROUND_HALF_EVEN);
 		return ResultSequenceFactory.create_new(new XSDecimal(result));
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_INTEGER;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSLong.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSLong.java
index 6e04552..09ba895 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSLong.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSLong.java
@@ -1,103 +1,105 @@
-/*******************************************************************************

- * Copyright (c) 2009 Mukul Gandhi, and others

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *     Mukul Gandhi - bug 274952 - Initial API and implementation, of xs:long data 

- *                                 type.

- *******************************************************************************/

-

-package org.eclipse.wst.xml.xpath2.processor.internal.types;

-

-import java.math.BigInteger;

-

-import org.eclipse.wst.xml.xpath2.processor.DynamicError;

-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;

-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;

-

-public class XSLong extends XSInteger {

-	

-	private static final String XS_LONG = "xs:long";

-

-	/**

-	 * Initializes a representation of 0

-	 */

-	public XSLong() {

-	  this(BigInteger.valueOf(0));

-	}

-	

-	/**

-	 * Initializes a representation of the supplied long value

-	 * 

-	 * @param x

-	 *            Long to be stored

-	 */

-	public XSLong(BigInteger x) {

-		super(x);

-	}

-	

-	/**

-	 * Retrieves the datatype's full pathname

-	 * 

-	 * @return "xs:long" which is the datatype's full pathname

-	 */

-	@Override

-	public String string_type() {

-		return XS_LONG;

-	}

-	

-	/**

-	 * Retrieves the datatype's name

-	 * 

-	 * @return "long" which is the datatype's name

-	 */

-	@Override

-	public String type_name() {

-		return "long";

-	}

-	

-	/**

-	 * Creates a new ResultSequence consisting of the extractable long in the

-	 * supplied ResultSequence

-	 * 

-	 * @param arg

-	 *            The ResultSequence from which the long is to be extracted

-	 * @return New ResultSequence consisting of the 'long' supplied

-	 * @throws DynamicError

-	 */

-	@Override

-	public ResultSequence constructor(ResultSequence arg) throws DynamicError {

-		ResultSequence rs = ResultSequenceFactory.create_new();

-

-		if (arg.empty())

-			return rs;

-

-		// the function conversion rules apply here too. Get the argument

-		// and convert it's string value to a long.

-		AnyType aat = arg.first();

-

-		try {

-			BigInteger bigInt = new BigInteger(aat.string_value());

-			

-			// doing the range checking

-			BigInteger min = BigInteger.valueOf(-9223372036854775808L);

-			BigInteger max = BigInteger.valueOf(9223372036854775807L);			

-

-			if (bigInt.compareTo(min) < 0 || bigInt.compareTo(max) > 0) {

-			   // invalid input

-			   DynamicError.throw_type_error();	

-			}

-			

-			rs.add(new XSLong(bigInt));

-			

-			return rs;

-		} catch (NumberFormatException e) {

-			throw DynamicError.cant_cast(null);

-		}

-

-	}

-

-}

+/*******************************************************************************
+ * Copyright (c) 2009 Mukul Gandhi, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Mukul Gandhi - bug 274952 - Initial API and implementation, of xs:long data 
+ *                                 type.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.processor.internal.types;
+
+import java.math.BigInteger;
+
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+
+public class XSLong extends XSInteger {
+	
+	private static final String XS_LONG = "xs:long";
+
+	/**
+	 * Initializes a representation of 0
+	 */
+	public XSLong() {
+	  this(BigInteger.valueOf(0));
+	}
+	
+	/**
+	 * Initializes a representation of the supplied long value
+	 * 
+	 * @param x
+	 *            Long to be stored
+	 */
+	public XSLong(BigInteger x) {
+		super(x);
+	}
+	
+	/**
+	 * Retrieves the datatype's full pathname
+	 * 
+	 * @return "xs:long" which is the datatype's full pathname
+	 */
+	public String string_type() {
+		return XS_LONG;
+	}
+	
+	/**
+	 * Retrieves the datatype's name
+	 * 
+	 * @return "long" which is the datatype's name
+	 */
+	public String type_name() {
+		return "long";
+	}
+	
+	/**
+	 * Creates a new ResultSequence consisting of the extractable long in the
+	 * supplied ResultSequence
+	 * 
+	 * @param arg
+	 *            The ResultSequence from which the long is to be extracted
+	 * @return New ResultSequence consisting of the 'long' supplied
+	 * @throws DynamicError
+	 */
+	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
+
+		if (arg.empty())
+			return ResultBuffer.EMPTY;
+
+		// the function conversion rules apply here too. Get the argument
+		// and convert it's string value to a long.
+		Item aat = arg.first();
+
+		try {
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
+			
+			// doing the range checking
+			BigInteger min = BigInteger.valueOf(-9223372036854775808L);
+			BigInteger max = BigInteger.valueOf(9223372036854775807L);			
+
+			if (bigInt.compareTo(min) < 0 || bigInt.compareTo(max) > 0) {
+			   // invalid input
+			   DynamicError.throw_type_error();	
+			}
+			
+			return new XSLong(bigInt);
+		} catch (NumberFormatException e) {
+			throw DynamicError.cant_cast(null);
+		}
+
+	}
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_LONG;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNCName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNCName.java
index dbfe459..61bc7f6 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNCName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNCName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,9 +14,11 @@
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import org.apache.xerces.util.XMLChar;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the NCName datatype
@@ -46,7 +48,6 @@
 	 * 
 	 * @return "xs:NCName" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_NC_NAME;
 	}
@@ -56,7 +57,6 @@
 	 * 
 	 * @return "NCName" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "NCName";
 	}
@@ -70,24 +70,19 @@
 	 * @return New ResultSequence consisting of the NCName supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-		
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
-		String strValue = aat.string_value();
+		String strValue = aat.getStringValue();
 		
 		if (!isConstraintSatisfied(strValue)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 
-		rs.add(new XSNCName(strValue));
-
-		return rs;
+		return new XSNCName(strValue);
 	}
 	
 	/*
@@ -104,4 +99,8 @@
 		return isValidNCName;
 		
 	} // isConstraintSatisfied
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NCNAME;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNMTOKEN.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNMTOKEN.java
index 4a78276..c1fb4b9 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNMTOKEN.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNMTOKEN.java
@@ -14,9 +14,11 @@
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import org.apache.xerces.util.XMLChar;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the NMTOKEN datatype
@@ -46,7 +48,6 @@
 	 * 
 	 * @return "xs:NMTOKEN" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_NMTOKEN;
 	}
@@ -56,7 +57,6 @@
 	 * 
 	 * @return "NMTOKEN" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "NMTOKEN";
 	}
@@ -70,23 +70,23 @@
 	 * @return New ResultSequence consisting of the NMTOKEN supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
-		String strValue = aat.string_value();
+		String strValue = aat.getStringValue();
 		
 		if (!XMLChar.isValidNmtoken(strValue)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 
-		rs.add(new XSNMTOKEN(strValue));
-
-		return rs;
+		return new XSNMTOKEN(strValue);
 	}
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NMTOKEN;
+	}
+	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSName.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSName.java
index 5a21a61..4c19fe3 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSName.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSName.java
@@ -14,9 +14,11 @@
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import org.apache.xerces.util.XMLChar;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the Name datatype
@@ -46,7 +48,6 @@
 	 * 
 	 * @return "xs:Name" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_NAME;
 	}
@@ -56,7 +57,6 @@
 	 * 
 	 * @return "Name" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "Name";
 	}
@@ -70,23 +70,22 @@
 	 * @return New ResultSequence consisting of the Name supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
-		String strValue = aat.string_value();
+		String strValue = aat.getStringValue();
 		
 		if (!XMLChar.isValidName(strValue)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 
-		rs.add(new XSName(strValue));
+		return new XSName(strValue);
+	}
 
-		return rs;
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NAME;
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNegativeInteger.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNegativeInteger.java
index 0488742..7add701 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNegativeInteger.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNegativeInteger.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277602 - Initial API and implementation, of xs:negativeInteger
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSNegativeInteger extends XSNonPositiveInteger {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:negativeInteger" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_NEGATIVE_INTEGER;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "negativeInteger" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "negativeInteger";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'negativeInteger' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a nonPositiveInteger.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is, -INF
@@ -93,13 +92,15 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSNegativeInteger(bigInt));
-			
-			return rs;
+			return new XSNegativeInteger(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NEGATIVEINTEGER;
+	}
+	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonNegativeInteger.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonNegativeInteger.java
index 15ce0d9..f3da7e1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonNegativeInteger.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonNegativeInteger.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277609 - Initial API and implementation, of xs:nonNegativeInteger
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSNonNegativeInteger extends XSInteger {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:nonNegativeInteger" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_NON_NEGATIVE_INTEGER;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "nonNegativeInteger" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "nonNegativeInteger";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'nonNegativeInteger' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a nonNegativeInteger.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is, 0
@@ -93,13 +92,19 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSNonNegativeInteger(bigInt));
-			
-			return rs;
+			return new XSNonNegativeInteger(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NONNEGATIVEINTEGER;
+	}
+
+	public Object getNativeValue() {
+		return getValue().longValue();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonPositiveInteger.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonPositiveInteger.java
index 09412d4..3ed88db 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonPositiveInteger.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNonPositiveInteger.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277599 - Initial API and implementation, of xs:nonPositiveInteger
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSNonPositiveInteger extends XSInteger {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:nonPositiveInteger" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_NON_POSITIVE_INTEGER;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "nonPositiveInteger" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "nonPositiveInteger";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'nonPositiveInteger' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a nonPositiveInteger.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is, -INF
@@ -93,13 +92,19 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSNonPositiveInteger(bigInt));
-			
-			return rs;
+			return new XSNonPositiveInteger(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NONPOSITIVEINTEGER;
+	}
+
+	public Object getNativeValue() {
+		return getValue().longValue();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNormalizedString.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNormalizedString.java
index c5453cc..8fdde47 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNormalizedString.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNormalizedString.java
@@ -12,9 +12,12 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the xs:normalizedString datatype
@@ -45,7 +48,6 @@
 	 * 
 	 * @return "xs:normalizedString" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_NORMALIZEDSTRING;
 	}
@@ -55,7 +57,6 @@
 	 * 
 	 * @return "normalizedString" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "normalizedString";
 	}
@@ -69,24 +70,19 @@
 	 * @return New ResultSequence consisting of the supplied String
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-		   return rs;
+		   return ResultBuffer.EMPTY;
 
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
-		String srcString = aat.string_value();
+		String srcString = aat.getStringValue();
 		if (!isSatisfiesConstraints(srcString)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 		
-		rs.add(new XSNormalizedString(srcString));
-
-		return rs;
+		return new XSNormalizedString(srcString);
 	}
 	
 	/*
@@ -106,4 +102,8 @@
 		  
 	} // isSatisfiesConstraints
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NORMALIZEDSTRING;
+	}
+	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNotation.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNotation.java
index 6da4a0b..bf60652 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNotation.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSNotation.java
@@ -7,36 +7,43 @@
  *
  * Contributors:
  *     David Carver (STAR) bug 282223 - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSNotation extends CtrType {
 
 	private static final String XS_NOTATION = "xs:NOTATION";
 
-	@Override
 	public String string_type() {
 		return XS_NOTATION;
 	}
 
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return null;
 	}
 
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
 		if (arg.empty())
 			DynamicError.throw_type_error();
 		throw new DynamicError("XPST0080", "Can't Cast to NOTATION");
 	}
 
-	@Override
 	public String type_name() {
 		return "NOTATION";
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_NOTATION;
+	}
+
+	public Object getNativeValue() {
+		return getStringValue();
+	}
+	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSPositiveInteger.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSPositiveInteger.java
index 3465faa..108f714 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSPositiveInteger.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSPositiveInteger.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277632 - Initial API and implementation, of xs:positiveInteger
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSPositiveInteger extends XSNonNegativeInteger {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:positiveInteger" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_POSITIVE_INTEGER;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "positiveInteger" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "positiveInteger";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'positiveInteger' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a positiveInteger.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is 1
@@ -93,13 +92,19 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSPositiveInteger(bigInt));
-			
-			return rs;
+			return new XSPositiveInteger(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_POSITIVEINTEGER;
+	}
+
+	public Object getNativeValue() {
+		return getValue();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSShort.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSShort.java
index 7487cd6..e62f82f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSShort.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSShort.java
@@ -7,15 +7,19 @@
  *
  * Contributors:
  *     Mukul Gandhi - bug 277608 - implementation of xs:short data type
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSShort extends XSInt {
 	
@@ -43,7 +47,6 @@
 	 * 
 	 * @return "xs:short" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_SHORT;
 	}
@@ -53,7 +56,6 @@
 	 * 
 	 * @return "short" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "short";
 	}
@@ -67,19 +69,16 @@
 	 * @return New ResultSequence consisting of the 'short' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a short.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			BigInteger min = BigInteger.valueOf(-32768L);
@@ -90,13 +89,19 @@
 			   DynamicError.throw_type_error();	
 			}
 			
-			rs.add(new XSShort(bigInt));
-			
-			return rs;
+			return new XSShort(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_SHORT;
+	}
+
+	public Object getNativeValue() {
+		return getValue().shortValue();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSString.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSString.java
index 85ea1d1..00bcde8 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSString.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSString.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,20 +10,24 @@
  *     Mukul Gandhi - improved comparison of xs:string with other XDM types
  *  Jesper S Moller - bug 286061   correct handling of quoted string 
  *  Jesper S Moller - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
 import org.eclipse.wst.xml.xpath2.processor.internal.function.FnCompare;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the String datatype
@@ -55,7 +59,6 @@
 	 * 
 	 * @return "xs:string" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_STRING;
 	}
@@ -65,7 +68,6 @@
 	 * 
 	 * @return "string" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "string";
 	}
@@ -76,8 +78,7 @@
 	 * 
 	 * @return The String stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value;
 	}
 
@@ -88,7 +89,7 @@
 	 * @return The String stored
 	 */
 	public String value() {
-		return string_value();
+		return getStringValue();
 	}
 
 	/**
@@ -100,19 +101,14 @@
 	 * @return New ResultSequence consisting of the supplied String
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		//AnyAtomicType aat = (AnyAtomicType) arg.first();
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
-		rs.add(new XSString(aat.string_value()));
-
-		return rs;
+		return new XSString(aat.getStringValue());
 	}
 
 	// comparisons
@@ -123,9 +119,9 @@
 		// XXX: This can't happen, I guess
 		if (arg == null) return 666;
 
-		XSString comparand = arg instanceof XSString ? (XSString)arg : new XSString(arg.string_value());
+		XSString comparand = arg instanceof XSString ? (XSString)arg : new XSString(arg.getStringValue());
 		
-		BigInteger result = FnCompare.compare_string(dc.default_collation_name(), this, comparand, dc);
+		BigInteger result = FnCompare.compare_string(dc.getCollationProvider().getDefaultCollation(), this, comparand, dc);
 
 		return result.intValue();
 	}
@@ -140,8 +136,8 @@
 	 *         otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
-		int cmp = do_compare(arg, context);
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
+		int cmp = do_compare(arg, dynamicContext);
 
 		// XXX im not sure what to do here!!! because eq has to return
 		// something i fink....
@@ -186,5 +182,12 @@
 
 		return cmp < 0;
 	}
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_STRING;
+	}
+
+	public Object getNativeValue() {
+		return _value;
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSTime.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSTime.java
index fc8be42..2caf1c6 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSTime.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSTime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,23 +12,32 @@
  *                                 correction of casting to time. 
  *     David Carver - bug 280547 - fix dates for comparison 
  *     Jesper Steen Moller - bug 262765 - fix type tests
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
 
-import java.util.*;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathMinus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathPlus;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
+
 /**
  * A representation of the Time datatype
  */
@@ -74,7 +83,6 @@
 	 * @return New XSTime representing the copy of the time and timezone
 	 * @throws CloneNotSupportedException
 	 */
-	@Override
 	public Object clone() throws CloneNotSupportedException {
 		Calendar c = (Calendar) calendar().clone();
 		XSDuration t = tz();
@@ -90,7 +98,6 @@
 	 * 
 	 * @return "time" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "time";
 	}
@@ -122,27 +129,21 @@
 	 * @return New ResultSequence consisting of the supplied time
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (!isCastable(aat)) {
 			throw DynamicError.invalidType();
 		}
-
 		
 		CalendarType t = castTime(aat);
 
 		if (t == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(t);
-
-		return rs;
+		return t;
 	} 
 
 	private boolean isCastable(AnyAtomicType aat) {
@@ -170,7 +171,7 @@
 			return new XSTime(dateTime.calendar(), dateTime.tz());
 		}
 		
-		return parse_time(aat.string_value());
+		return parse_time(aat.getStringValue());
 	}
 	/**
 	 * Retrieves the hour stored as an integer
@@ -220,8 +221,7 @@
 	 * 
 	 * @return String representation of the time stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String ret = "";
 		
 		Calendar adjustFortimezone = calendar();
@@ -275,7 +275,6 @@
 	 * 
 	 * @return "xs:time" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_TIME;
 	}
@@ -317,7 +316,7 @@
 	 * @return True if both XSTime's represent the same time. False otherwise
 	 * @throws DynamicError
 	 */
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		XSTime val = (XSTime) NumericType.get_single_type(arg, XSTime.class);
 		Calendar thiscal = normalizeCalendar(calendar(), tz());
 		Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());
@@ -373,7 +372,7 @@
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg.first();
+		Item at = arg.first();
 		
 		if (!(at instanceof XSTime) && !(at instanceof XSDayTimeDuration)) {
 			throw DynamicError.throw_type_error();
@@ -389,7 +388,7 @@
 		return null; // unreach
 	}
 
-	private ResultSequence minusXSDayTimeDuration(AnyType at) {
+	private ResultSequence minusXSDayTimeDuration(Item at) {
 		XSDuration val = (XSDuration) at;
 
 		XSTime res = null;
@@ -399,30 +398,22 @@
 			return null;
 		}
 
-		try {
-			XMLGregorianCalendar xmlCal = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar)calendar());
-			Duration dtduration = DatatypeFactory.newInstance().newDuration(val.string_value());
-			xmlCal.add(dtduration.negate());
-			res = new XSTime(xmlCal.toGregorianCalendar(), res.tz());
-		} catch (DatatypeConfigurationException ex) {
-			
-		}
+		XMLGregorianCalendar xmlCal = _datatypeFactory.newXMLGregorianCalendar((GregorianCalendar)calendar());
+		Duration dtduration = _datatypeFactory.newDuration(val.getStringValue());
+		xmlCal.add(dtduration.negate());
+		res = new XSTime(xmlCal.toGregorianCalendar(), res.tz());
 
 		return ResultSequenceFactory.create_new(res);
 	}
 
-	private ResultSequence minusXSTimeDuration(AnyType at) {
+	private ResultSequence minusXSTimeDuration(Item at) {
 		XSTime val = (XSTime) at;
 		Duration dtduration = null;
-		try {
-			Calendar thisCal = normalizeCalendar(calendar(), tz());
-			Calendar thatCal = normalizeCalendar(val.calendar(), val.tz());
-			long duration = thisCal.getTimeInMillis() - thatCal.getTimeInMillis();
-			dtduration = DatatypeFactory.newInstance().newDuration(duration);
-			return ResultSequenceFactory.create_new(XSDayTimeDuration.parseDTDuration(dtduration.toString()));
-		} catch (DatatypeConfigurationException ex) {
-			return null;
-		}
+		Calendar thisCal = normalizeCalendar(calendar(), tz());
+		Calendar thatCal = normalizeCalendar(val.calendar(), val.tz());
+		long duration = thisCal.getTimeInMillis() - thatCal.getTimeInMillis();
+		dtduration = _datatypeFactory.newDuration(duration);
+		return ResultSequenceFactory.create_new(XSDayTimeDuration.parseDTDuration(dtduration.toString()));
 	}
 
 	/**
@@ -452,4 +443,12 @@
 			return null;
 		}
 	}
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_TIME;
+	}
+
+	public Object getNativeValue() {
+		return _calendar.clone();
+	}	
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSToken.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSToken.java
index ac797d4..65c1d53 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSToken.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSToken.java
@@ -11,9 +11,12 @@
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the xs:token datatype
@@ -44,7 +47,6 @@
 	 * 
 	 * @return "xs:token" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_TOKEN;
 	}
@@ -54,7 +56,6 @@
 	 * 
 	 * @return "token" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "token";
 	}
@@ -68,24 +69,19 @@
 	 * @return New ResultSequence consisting of the supplied String
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-		   return rs;
+		   return ResultBuffer.EMPTY;
 
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
-		String srcString = aat.string_value();
+		String srcString = aat.getStringValue();
 		if (!isSatisfiesConstraints(srcString)) {
 			// invalid input
 			DynamicError.throw_type_error();
 		}
 		
-		rs.add(new XSToken(srcString));
-
-		return rs;
+		return new XSToken(srcString);
 	}
 	
 	/*
@@ -106,4 +102,8 @@
 		  
 	} // isSatisfiesConstraints
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_TOKEN;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedByte.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedByte.java
index 12b9a5e..01d5f6d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedByte.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedByte.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277650 - Initial API and implementation, of xs:unsignedByte
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSUnsignedByte extends XSUnsignedShort {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:unsignedByte" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_UNSIGNED_BYTE;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "unsignedByte" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "unsignedByte";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'unsignedByte' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a unsignedByte.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is 0
@@ -94,13 +93,19 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSUnsignedByte(bigInt));
-			
-			return rs;
+			return new XSUnsignedByte(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNSIGNEDBYTE;
+	}
+
+	public Object getNativeValue() {
+		return getValue().shortValue();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedInt.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedInt.java
index 122a6ff..462f1ee 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedInt.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedInt.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277642 - Initial API and implementation, of xs:unsignedInt
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSUnsignedInt extends XSUnsignedLong {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:unsignedInt" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_UNSIGNED_INT;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "unsignedInt" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "unsignedInt";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'unsignedInt' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a unsignedInt.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is 0
@@ -94,13 +93,18 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSUnsignedInt(bigInt));
-			
-			return rs;
+			return new XSUnsignedInt(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNSIGNEDINT;
+	}
+
+	public Object getNativeValue() {
+		return getValue().longValue();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedLong.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedLong.java
index ac67028..7b7dcd1 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedLong.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedLong.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277629 - Initial API and implementation, of xs:unsignedLong
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSUnsignedLong extends XSNonNegativeInteger {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:unsignedLong" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_UNSIGNED_LONG;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "unsignedLong" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "unsignedLong";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'unsignedLong' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a unsignedLong.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is 0
@@ -94,13 +93,19 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSUnsignedLong(bigInt));
-			
-			return rs;
+			return new XSUnsignedLong(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNSIGNEDLONG;
+	}
+
+	public Object getNativeValue() {
+		return getValue();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedShort.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedShort.java
index 3633e7f..4da5af0 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedShort.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUnsignedShort.java
@@ -9,15 +9,19 @@
  *     Mukul Gandhi - bug 277645 - Initial API and implementation, of xs:unsignedShort
  *                                 data type.
  *     David Carver (STAR) - bug 262765 - fixed abs value tests.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigInteger;
 
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 public class XSUnsignedShort extends XSUnsignedInt {
 	
@@ -45,7 +49,6 @@
 	 * 
 	 * @return "xs:unsignedShort" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_UNSIGNED_SHORT;
 	}
@@ -55,7 +58,6 @@
 	 * 
 	 * @return "unsignedShort" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "unsignedShort";
 	}
@@ -69,19 +71,16 @@
 	 * @return New ResultSequence consisting of the 'unsignedShort' supplied
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		// the function conversion rules apply here too. Get the argument
 		// and convert it's string value to a unsignedShort.
-		AnyType aat = arg.first();
+		Item aat = arg.first();
 
 		try {
-			BigInteger bigInt = new BigInteger(aat.string_value());
+			BigInteger bigInt = new BigInteger(aat.getStringValue());
 			
 			// doing the range checking
 			// min value is 0
@@ -94,13 +93,19 @@
 			   throw DynamicError.cant_cast(null);	
 			}
 			
-			rs.add(new XSUnsignedShort(bigInt));
-			
-			return rs;
+			return new XSUnsignedShort(bigInt);
 		} catch (NumberFormatException e) {
 			throw DynamicError.cant_cast(null);
 		}
 
 	}
 
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNSIGNEDSHORT;
+	}
+
+	public Object getNativeValue() {
+		return getValue().intValue();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUntypedAtomic.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUntypedAtomic.java
index 95681e3..de68b08 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUntypedAtomic.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSUntypedAtomic.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,13 +8,16 @@
  * Contributors:
  *     Andrea Bittau - initial API and implementation from the PsychoPath XPath 2.0
  *     David Carver - bug 262765 - corrected implementation of XSUntypedAtomic 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the UntypedAtomic datatype which is used to represent
@@ -45,7 +48,6 @@
 	 * 
 	 * @return "xs:untypedAtomic" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_UNTYPED_ATOMIC;
 	}
@@ -56,27 +58,28 @@
 	 * 
 	 * @return String representation of the value of this untyped atomic node
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		return _value;
 	}
 
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
-
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
-
-		rs.add(new XSUntypedAtomic(aat.string_value()));
-
-		return rs;
+		return new XSUntypedAtomic(aat.getStringValue());
 	}
 
-	@Override
 	public String type_name() {
 		return "untypedAtomic";
 	}
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_UNTYPEDATOMIC;
+	}
+
+	public Object getNativeValue() {
+		return _value;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSYearMonthDuration.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSYearMonthDuration.java
index c3329d2..e86ef64 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSYearMonthDuration.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/XSYearMonthDuration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 Andrea Bittau, University College London, and others
+ * Copyright (c) 2005, 2010 Andrea Bittau, University College London, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,17 +11,28 @@
  *     Mukul Gandhi - bug 279373 - improvements to multiply operation on xs:yearMonthDuration
  *                                 data type.
  *     David Carver - bug 282223 - implementation of xs:duration data type.
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.types;
 
 import java.math.BigDecimal;
 
-import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.DynamicContext;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultBuffer;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.function.*;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpEq;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpGt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.CmpLt;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathDiv;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathMinus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathPlus;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.MathTimes;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 
 /**
  * A representation of the YearMonthDuration datatype
@@ -160,7 +171,6 @@
 	 * 
 	 * @return "yearMonthDuration" which is the datatype's name
 	 */
-	@Override
 	public String type_name() {
 		return "yearMonthDuration";
 	}
@@ -174,12 +184,10 @@
 	 * @return New ResultSequence consisting of the time duration extracted
 	 * @throws DynamicError
 	 */
-	@Override
 	public ResultSequence constructor(ResultSequence arg) throws DynamicError {
-		ResultSequence rs = ResultSequenceFactory.create_new();
 
 		if (arg.empty())
-			return rs;
+			return ResultBuffer.EMPTY;
 
 		AnyAtomicType aat = (AnyAtomicType) arg.first();
 		if (aat instanceof NumericType || aat instanceof CalendarType ||
@@ -192,15 +200,12 @@
 			throw DynamicError.cant_cast(null);
 		}
 
-		
 		XSDuration ymd = castYearMonthDuration(aat);
 
 		if (ymd == null)
 			throw DynamicError.cant_cast(null);
 
-		rs.add(ymd);
-
-		return rs;
+		return ymd;
 	}
 	
 	private XSDuration castYearMonthDuration(AnyAtomicType aat) {
@@ -209,7 +214,7 @@
 			return new XSYearMonthDuration(duration.year(), duration.month(), duration.negative());
 		}
 		
-		return parseYMDuration(aat.string_value());
+		return parseYMDuration(aat.getStringValue());
 	}
 
 	/**
@@ -219,7 +224,6 @@
 	 * @return True if this duration represents a backward passage through time.
 	 *         False otherwise
 	 */
-	@Override
 	public boolean negative() {
 		return _negative;
 	}
@@ -229,8 +233,7 @@
 	 * 
 	 * @return String representation of the duration of time stored
 	 */
-	@Override
-	public String string_value() {
+	public String getStringValue() {
 		String strval = "";
 
 		if (negative())
@@ -257,7 +260,6 @@
 	 * 
 	 * @return "xs:yearMonthDuration" which is the datatype's full pathname
 	 */
-	@Override
 	public String string_type() {
 		return XS_YEAR_MONTH_DURATION;
 	}
@@ -284,8 +286,7 @@
 	 * @return True if they both represent the duration of time. False otherwise
 	 * @throws DynamicError
 	 */
-	@Override
-	public boolean eq(AnyType arg, DynamicContext context) throws DynamicError {
+	public boolean eq(AnyType arg, DynamicContext dynamicContext) throws DynamicError {
 		if (arg instanceof XSDayTimeDuration) {
 			XSDayTimeDuration dayTimeDuration = (XSDayTimeDuration)arg;
 			return (monthValue() == 0 && dayTimeDuration.value() == 0.0);
@@ -295,7 +296,7 @@
 		}
 		XSDuration val = (XSDuration) NumericType
 				.get_single_type(arg, XSDuration.class);
-		return super.eq(val, context);
+		return super.eq(val, dynamicContext);
 	}
 
 	/**
@@ -307,7 +308,6 @@
 	 *         stored. False otherwise
 	 * @throws DynamicError
 	 */
-	@Override
 	public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
 		XSYearMonthDuration val = (XSYearMonthDuration) NumericType
 				.get_single_type(arg, XSYearMonthDuration.class);
@@ -324,7 +324,6 @@
 	 *         stored. False otherwise
 	 * @throws DynamicError
 	 */
-	@Override
 	public boolean gt(AnyType arg, DynamicContext context) throws DynamicError {
 		XSYearMonthDuration val = (XSYearMonthDuration) NumericType
 				.get_single_type(arg, XSYearMonthDuration.class);
@@ -383,9 +382,9 @@
 	public ResultSequence times(ResultSequence arg) throws DynamicError {
 		ResultSequence convertedRS = arg;		
 		if (arg.size() == 1) {
-			AnyType argValue = arg.first();
+			Item argValue = arg.first();
             if (argValue instanceof XSDecimal) {
-            	convertedRS = ResultSequenceFactory.create_new(new XSDouble(argValue.string_value()));	
+            	convertedRS = ResultSequenceFactory.create_new(new XSDouble(argValue.getStringValue()));	
             }
 		}
 		
@@ -419,7 +418,7 @@
 		if (arg.size() != 1)
 			DynamicError.throw_type_error();
 
-		AnyType at = arg.first();
+		Item at = arg.first();
 
 		if (at instanceof XSDouble) {
 			XSDouble dt = (XSDouble) at;
@@ -446,10 +445,15 @@
 
 			double res = (double) monthValue() / md.monthValue();
 
-			return ResultSequenceFactory.create_new(new XSDecimal(BigDecimal.valueOf(res)));
+			return ResultSequenceFactory.create_new(new XSDecimal(new BigDecimal(res)));
 		} else {
 			DynamicError.throw_type_error();
 			return null; // unreach
 		}
 	}	
+
+	public TypeDefinition getTypeDefinition() {
+		return BuiltinTypeLibrary.XS_YEARMONTHDURATION;
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/AtomicTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/AtomicTypeDefinition.java
new file mode 100644
index 0000000..eaa9292
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/AtomicTypeDefinition.java
@@ -0,0 +1,10 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin;
+
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+
+public interface AtomicTypeDefinition extends TypeDefinition {
+
+	public abstract SingleItemSequence construct(ResultSequence rs);
+	public abstract SingleItemSequence constructNative(Object rs);
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinAtomicTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinAtomicTypeDefinition.java
new file mode 100644
index 0000000..09b0530
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinAtomicTypeDefinition.java
@@ -0,0 +1,13 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin;
+
+
+public class BuiltinAtomicTypeDefinition extends BuiltinTypeDefinition {
+
+	public BuiltinAtomicTypeDefinition(String name, Class implementationClass, Class nativeType, BuiltinTypeDefinition baseType) {
+		super(name, implementationClass, nativeType, baseType);
+	}
+	
+	public boolean isAbstract() {
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinListTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinListTypeDefinition.java
new file mode 100644
index 0000000..da55af0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinListTypeDefinition.java
@@ -0,0 +1,73 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+
+public class BuiltinListTypeDefinition extends BuiltinTypeDefinition implements SimpleTypeDefinition {
+	
+	private final BuiltinAtomicTypeDefinition itemType;
+
+	public BuiltinListTypeDefinition(QName name, BuiltinTypeDefinition baseType, BuiltinAtomicTypeDefinition itemType) {
+		super(name, null, Collection.class, baseType);
+		this.itemType = itemType;
+	}
+
+	public BuiltinListTypeDefinition(String name, BuiltinTypeDefinition baseType, BuiltinAtomicTypeDefinition itemType) {
+		super(name, null, Collection.class, baseType);
+		this.itemType = itemType;
+	}
+
+	public boolean isAbstract() {
+		return false;
+	}
+
+	public short getVariety() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public SimpleTypeDefinition getPrimitiveType() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public short getBuiltInKind() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public TypeDefinition getItemType() {
+		return itemType;
+	}
+
+	public List getMemberTypes() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public short getOrdered() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public boolean getFinite() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean getBounded() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean getNumeric() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+	
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinTypeDefinition.java
new file mode 100644
index 0000000..eced33c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinTypeDefinition.java
@@ -0,0 +1,136 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.processor.internal.XPathError;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+public class BuiltinTypeDefinition implements AtomicTypeDefinition  {
+	
+	public final static String XS_NS = "http://www.w3.org/2001/XMLSchema"; 
+	
+	private final QName name;
+	private final Class implementationClass;
+	private final Class nativeType;
+	private final BuiltinTypeDefinition baseType;
+	private final Method constructorMethod;
+	private final Method constructorFromNativeMethod;
+
+	public BuiltinTypeDefinition(QName name, BuiltinTypeDefinition baseType) {
+		this(name, null, null, baseType);
+	}
+
+	public BuiltinTypeDefinition(String name, BuiltinTypeDefinition baseType) {
+		this(name, null, null, baseType);
+	}
+
+	public BuiltinTypeDefinition(QName name, Class implementationClass, Class nativeType, BuiltinTypeDefinition baseType) {
+		this.name = name;
+		this.implementationClass = implementationClass;
+		this.nativeType = nativeType;
+		this.baseType = baseType;
+		
+		Method m = null;
+		try {
+			m = implementationClass != null ? implementationClass.getMethod("constructor", ResultSequence.class) : null;
+		} catch (SecurityException e) {
+			throw new RuntimeException(e);
+		} catch (NoSuchMethodException e) {
+		}
+		this.constructorMethod = m;
+
+		m = null;
+		try {
+			m = implementationClass != null ? implementationClass.getMethod("constructor", nativeType) : null;
+		} catch (SecurityException e) {
+			throw new RuntimeException(e);
+		} catch (NoSuchMethodException e) {
+			// We'll live
+		}
+		this.constructorFromNativeMethod = m;
+
+	}
+
+	public boolean isAbstract() {
+		return implementationClass == null;
+	}
+	
+	public BuiltinTypeDefinition(String name, Class implementationClass, Class nativeType, BuiltinTypeDefinition baseType) {
+		this(new QName(XS_NS, name), implementationClass, nativeType, baseType);
+	}
+	
+	public String getNamespace() {
+		return name.getNamespaceURI();
+	}
+
+	public String getName() {
+		return name.getLocalPart();
+	}
+
+	public TypeDefinition getBaseType() {
+		return baseType;
+	}
+
+	public boolean derivedFromType(TypeDefinition ancestorType, short derivationMethod) {
+		if (ancestorType == this) return true;
+		if (baseType == null) return false;
+		return baseType.derivedFromType(ancestorType, derivationMethod);
+	}
+
+	public boolean derivedFrom(String namespace, String name, short derivationMethod) {
+		if (namespace.equals(getNamespace()) && name.equals(getName())) return true;
+		
+		if (baseType == null) return false;
+		
+		return baseType.derivedFrom(namespace, name, derivationMethod);
+	}
+
+	public List getSimpleTypes(Attr attr) {
+		return Collections.emptyList();
+	}
+
+	public List getSimpleTypes(Element attr) {
+		return Collections.emptyList();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition#construct(org.eclipse.wst.xml.xpath2.api.ResultSequence)
+	 */
+	public SingleItemSequence construct(ResultSequence rs) {
+		try {
+			if (implementationClass == null) throw new XPathError("Type " + getName() + " is abstract!");
+			return (SingleItemSequence)constructorMethod.invoke(null, new Object[] { rs });
+		}
+		catch (IllegalAccessException e) {
+			throw new RuntimeException(e);
+		}
+		catch (InvocationTargetException e) {
+			throw new RuntimeException(e);
+		}
+	}
+	
+	public SingleItemSequence constructNative(Object obj) {
+		try {
+			if (constructorFromNativeMethod == null) throw new XPathError("Type " + getName() + " cannot be constructed from native object!");
+			return (SingleItemSequence)constructorFromNativeMethod.invoke(null, new Object[] { obj });
+		}
+		catch (IllegalAccessException e) {
+			throw new RuntimeException(e);
+		}
+		catch (InvocationTargetException e) {
+			throw new RuntimeException(e);
+		}
+	}
+	
+	public Class getNativeType() {
+		return nativeType;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinTypeLibrary.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinTypeLibrary.java
new file mode 100644
index 0000000..d3b0231
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/BuiltinTypeLibrary.java
@@ -0,0 +1,222 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.datatype.Duration;
+
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBase64Binary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSByte;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSEntity;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSHexBinary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSID;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSIDREF;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNMTOKEN;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSString;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration;
+import org.w3c.dom.Node;
+
+
+/**
+ * This type captures all of the built-in XPath 2.0 types, as defined in F&O specification.
+ * http://www.w3.org/TR/xquery-operators/#datatypes
+ */
+public class BuiltinTypeLibrary {
+	// This type captures all of the built-in XPath 2.0 types, as defined in F&O specification.
+	// http://www.w3.org/TR/xquery-operators/#datatypes
+	
+	public final static BuiltinTypeDefinition XS_ANYTYPE = new BuiltinTypeDefinition("anyType", null);
+		public final static BuiltinTypeDefinition XS_UNTYPED = new BuiltinTypeDefinition("untyped", XS_ANYTYPE);
+		public final static BuiltinTypeDefinition XS_ANYSIMPLETYPE = new BuiltinTypeDefinition("anySimpleType", XS_ANYTYPE);
+			//	Subtypes of user-defined list and union types
+			//	xs:IDREFS
+			//	xs:NMTOKENS
+			//	xs:ENTITIES
+			//	xs:anyAtomicType
+			public final static BuiltinAtomicTypeDefinition XS_ANYATOMICTYPE = new BuiltinAtomicTypeDefinition("anyAtomicType", AnyAtomicType.class, Object.class, XS_ANYSIMPLETYPE);
+			
+	public final static BuiltinAtomicTypeDefinition XS_UNTYPEDATOMIC = new BuiltinAtomicTypeDefinition("untypedAtomic", null, String.class, XS_ANYATOMICTYPE);
+
+	public final static BuiltinAtomicTypeDefinition XS_DATETIME = new BuiltinAtomicTypeDefinition("dateTime", XSDateTime.class, Calendar.class,XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_DATE = new BuiltinAtomicTypeDefinition("date", XSDate.class, Calendar.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_TIME = new BuiltinAtomicTypeDefinition("time", XSTime.class, Calendar.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_DURATION = new BuiltinAtomicTypeDefinition("duration", XSDuration.class, Duration.class, XS_ANYATOMICTYPE);
+		public final static BuiltinAtomicTypeDefinition XS_YEARMONTHDURATION = new BuiltinAtomicTypeDefinition("yearMonthDuration", XSYearMonthDuration.class, Duration.class, XS_DURATION);
+		public final static BuiltinAtomicTypeDefinition XS_DAYTIMEDURATION = new BuiltinAtomicTypeDefinition("dayTimeDuration", XSDayTimeDuration.class, Duration.class, XS_DURATION);
+	public final static BuiltinAtomicTypeDefinition XS_FLOAT = new BuiltinAtomicTypeDefinition("float", XSFloat.class, Float.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_DOUBLE = new BuiltinAtomicTypeDefinition("double", XSDouble.class, Double.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_DECIMAL = new BuiltinAtomicTypeDefinition("decimal", XSDecimal.class, BigDecimal.class, XS_ANYATOMICTYPE);
+		public final static BuiltinAtomicTypeDefinition XS_INTEGER = new BuiltinAtomicTypeDefinition("integer", XSInteger.class, BigInteger.class, XS_DECIMAL);
+			public final static BuiltinAtomicTypeDefinition XS_NONPOSITIVEINTEGER = new BuiltinAtomicTypeDefinition("nonPositiveInteger",  XSNonPositiveInteger.class, BigInteger.class, XS_INTEGER);
+				public final static BuiltinAtomicTypeDefinition XS_NEGATIVEINTEGER = new BuiltinAtomicTypeDefinition("negativeInteger",  XSNegativeInteger.class, BigInteger.class, XS_NONPOSITIVEINTEGER);
+			public final static BuiltinAtomicTypeDefinition XS_LONG = new BuiltinAtomicTypeDefinition("long", XSLong.class, Long.class, XS_INTEGER);
+				public final static BuiltinAtomicTypeDefinition XS_INT = new BuiltinAtomicTypeDefinition("int", XSInt.class, Integer.class, XS_LONG);
+					public final static BuiltinAtomicTypeDefinition XS_SHORT = new BuiltinAtomicTypeDefinition("short", XSShort.class, Short.class, XS_INT);
+						public final static BuiltinAtomicTypeDefinition XS_BYTE = new BuiltinAtomicTypeDefinition("byte", XSByte.class, Byte.class, XS_SHORT);
+			public final static BuiltinAtomicTypeDefinition XS_NONNEGATIVEINTEGER = new BuiltinAtomicTypeDefinition("nonNegativeInteger", XSNonNegativeInteger.class, BigInteger.class, XS_INTEGER);
+				public final static BuiltinAtomicTypeDefinition XS_UNSIGNEDLONG = new BuiltinAtomicTypeDefinition("unsignedLong", XSUnsignedLong.class, BigInteger.class, XS_NONNEGATIVEINTEGER);
+					public final static BuiltinAtomicTypeDefinition XS_UNSIGNEDINT = new BuiltinAtomicTypeDefinition("unsignedInt", XSUnsignedInt.class, Long.class, XS_UNSIGNEDLONG);
+						public final static BuiltinAtomicTypeDefinition XS_UNSIGNEDSHORT = new BuiltinAtomicTypeDefinition("unsignedShort", XSUnsignedShort.class, Integer.class, XS_UNSIGNEDINT);
+							public final static BuiltinAtomicTypeDefinition XS_UNSIGNEDBYTE = new BuiltinAtomicTypeDefinition("unsignedByte", XSUnsignedByte.class, Short.class, XS_UNSIGNEDSHORT);
+				public final static BuiltinAtomicTypeDefinition XS_POSITIVEINTEGER = new BuiltinAtomicTypeDefinition("positiveInteger", XSPositiveInteger.class, BigInteger.class, XS_NONNEGATIVEINTEGER);
+	public final static BuiltinAtomicTypeDefinition XS_GYEARMONTH = new BuiltinAtomicTypeDefinition("gYearMonth", XSGYearMonth.class, Calendar.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_GYEAR = new BuiltinAtomicTypeDefinition("gYear", XSGYear.class, Calendar.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_GMONTHDAY = new BuiltinAtomicTypeDefinition("gMonthDay", XSGMonthDay.class, Calendar.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_GDAY = new BuiltinAtomicTypeDefinition("gDay", XSGDay.class, Calendar.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_GMONTH = new BuiltinAtomicTypeDefinition("gMonth", XSGMonth.class, Calendar.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_STRING = new BuiltinAtomicTypeDefinition("string", XSString.class, String.class, XS_ANYATOMICTYPE);
+		public final static BuiltinAtomicTypeDefinition XS_NORMALIZEDSTRING = new BuiltinAtomicTypeDefinition("normalizedString", XSString.class, String.class, XS_ANYATOMICTYPE);
+			public final static BuiltinAtomicTypeDefinition XS_TOKEN = new BuiltinAtomicTypeDefinition("token", XSToken.class, String.class, XS_NORMALIZEDSTRING);
+				public final static BuiltinAtomicTypeDefinition XS_LANGUAGE = new BuiltinAtomicTypeDefinition("language", XSToken.class, String.class, XS_TOKEN);
+				public final static BuiltinAtomicTypeDefinition XS_NMTOKEN = new BuiltinAtomicTypeDefinition("NMTOKEN", XSNMTOKEN.class, String.class, XS_TOKEN);
+				public final static BuiltinAtomicTypeDefinition XS_NAME = new BuiltinAtomicTypeDefinition("Name", XSName.class, String.class, XS_TOKEN);
+					public final static BuiltinAtomicTypeDefinition XS_NCNAME = new BuiltinAtomicTypeDefinition("NCName", XSNCName.class, String.class, XS_NAME);
+						public final static BuiltinAtomicTypeDefinition XS_ID = new BuiltinAtomicTypeDefinition("ID", XSID.class, String.class, XS_NCNAME);
+						public final static BuiltinAtomicTypeDefinition XS_IDREF = new BuiltinAtomicTypeDefinition("IDREF", XSIDREF.class, String.class, XS_NCNAME);
+						public final static BuiltinAtomicTypeDefinition XS_ENTITY = new BuiltinAtomicTypeDefinition("ENTITY", XSEntity.class, String.class, XS_NCNAME);
+	public final static BuiltinAtomicTypeDefinition XS_BOOLEAN = new BuiltinAtomicTypeDefinition("boolean", XSBoolean.class, Boolean.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_BASE64BINARY = new BuiltinAtomicTypeDefinition("base64Binary", XSBase64Binary.class, byte[].class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_HEXBINARY = new BuiltinAtomicTypeDefinition("hexBinary", XSHexBinary.class, byte[].class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_ANYURI = new BuiltinAtomicTypeDefinition("anyURI", XSAnyURI.class, String.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_QNAME = new BuiltinAtomicTypeDefinition("QName", QName.class, javax.xml.namespace.QName.class, XS_ANYATOMICTYPE);
+	public final static BuiltinAtomicTypeDefinition XS_NOTATION = new BuiltinAtomicTypeDefinition("NOTATION", XSNotation.class, String.class, XS_ANYATOMICTYPE);
+
+	// These are also subtypes of any types 
+	public final static BuiltinListTypeDefinition XS_IDREFS = new BuiltinListTypeDefinition("IDREFS", XS_ANYTYPE, XS_IDREF);
+	public final static BuiltinListTypeDefinition XS_NMTOKENS = new BuiltinListTypeDefinition("NMTOKENS", XS_ANYTYPE, XS_NMTOKEN);
+	public final static BuiltinListTypeDefinition XS_ENTITIES = new BuiltinListTypeDefinition("ENTITIES", XS_ANYTYPE, XS_ENTITY);
+	
+	public static final TypeModel BUILTIN_TYPES = new TypeModel() {
+
+		public TypeDefinition lookupType(String namespace, String typeName) {
+			if (! BuiltinTypeDefinition.XS_NS.equals(namespace)) return null;
+			return (TypeDefinition) builtinTypes.get(typeName);
+		}
+
+		public TypeDefinition lookupElementDeclaration(String namespace, String elementName) {
+			return null;
+		}
+
+		public TypeDefinition lookupAttributeDeclaration(String namespace, String attributeName) {
+			return null;
+		}
+		
+		private Map/*<String, BuiltinTypeDefinition>*/ builtinTypes = new HashMap/*<String, BuiltinTypeDefinition>*/();
+		{
+			addType(XS_ANYTYPE);
+			addType(XS_UNTYPED);
+			addType(XS_ANYSIMPLETYPE);
+			addType(XS_ANYATOMICTYPE);
+							
+			addType(XS_UNTYPEDATOMIC);
+			
+			addType(XS_DATETIME);
+			addType(XS_DATE);
+			addType(XS_TIME);
+			addType(XS_DURATION);
+			addType(XS_YEARMONTHDURATION);
+			addType(XS_DAYTIMEDURATION);
+			addType(XS_FLOAT);
+			addType(XS_DOUBLE);
+			addType(XS_DECIMAL);
+			addType(XS_INTEGER);
+			addType(XS_NONPOSITIVEINTEGER);
+			addType(XS_NEGATIVEINTEGER);
+			addType(XS_LONG);
+			addType(XS_INT);
+			addType(XS_SHORT);
+			addType(XS_BYTE);
+			addType(XS_NONNEGATIVEINTEGER);
+			addType(XS_UNSIGNEDLONG);
+			addType(XS_UNSIGNEDINT);
+			addType(XS_UNSIGNEDSHORT);
+			addType(XS_UNSIGNEDBYTE);
+			addType(XS_POSITIVEINTEGER);
+			addType(XS_GYEARMONTH);
+			addType(XS_GYEAR);
+			addType(XS_GMONTHDAY);
+			addType(XS_GDAY);
+			addType(XS_GMONTH);
+			addType(XS_STRING);
+			addType(XS_NORMALIZEDSTRING);
+			addType(XS_TOKEN);
+			addType(XS_LANGUAGE);
+			addType(XS_NMTOKEN);
+			addType(XS_NAME);
+			addType(XS_NCNAME);
+			addType(XS_ID);
+			addType(XS_IDREF);
+			addType(XS_ENTITY);
+			addType(XS_BOOLEAN);
+			addType(XS_BASE64BINARY);
+			addType(XS_HEXBINARY);
+			addType(XS_ANYURI);
+			addType(XS_QNAME);
+			addType(XS_NOTATION);
+			addType(XS_IDREFS);
+			addType(XS_NMTOKENS);
+			addType(XS_ENTITIES);
+		}
+
+		private void addType(BuiltinTypeDefinition btd) { builtinTypes.put(btd.getName(), btd); }
+
+		public TypeDefinition getType(Node node) {
+			return null;
+		}
+	};
+	
+	// Not types under XML Schema namespace
+//	item
+//	xs:anyAtomicType
+//	node
+//	attribute
+//	user-defined attribute types
+//	comment
+//	document
+//	user-defined document types
+//	element
+//	user-defined element types
+//	processing-instruction
+//	text
+
+	
+	
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/SingleItemSequence.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/SingleItemSequence.java
new file mode 100644
index 0000000..a11b443
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/SingleItemSequence.java
@@ -0,0 +1,8 @@
+package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin;
+
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
+
+public interface SingleItemSequence extends Item, ResultSequence {
+
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/ComplexXercesTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/ComplexXercesTypeDefinition.java
similarity index 90%
rename from bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/ComplexXercesTypeDefinition.java
rename to bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/ComplexXercesTypeDefinition.java
index e3dae96..d2fe4b8 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/ComplexXercesTypeDefinition.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/ComplexXercesTypeDefinition.java
@@ -1,10 +1,9 @@
-package org.eclipse.wst.xml.xpath2.processor.internal.types;
+package org.eclipse.wst.xml.xpath2.processor.internal.types.xerces;
 
 import org.apache.xerces.xs.XSComplexTypeDefinition;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.xerces.XercesTypeDefinition;
 import org.w3c.dom.NodeList;
 
 public class ComplexXercesTypeDefinition extends XercesTypeDefinition implements ComplexTypeDefinition {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleXercesType.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/SimpleXercesType.java
similarity index 95%
rename from bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleXercesType.java
rename to bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/SimpleXercesType.java
index 0b341d0..9c5a4dd 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleXercesType.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/SimpleXercesType.java
@@ -1,4 +1,4 @@
-package org.eclipse.wst.xml.xpath2.processor.internal.types;
+package org.eclipse.wst.xml.xpath2.processor.internal.types.xerces;
 
 import org.apache.xerces.impl.dv.InvalidDatatypeValueException;
 import org.apache.xerces.impl.dv.ValidatedInfo;
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleXercesTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/SimpleXercesTypeDefinition.java
similarity index 68%
rename from bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleXercesTypeDefinition.java
rename to bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/SimpleXercesTypeDefinition.java
index 0188cf7..c9acd0d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/SimpleXercesTypeDefinition.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/SimpleXercesTypeDefinition.java
@@ -1,21 +1,12 @@
-package org.eclipse.wst.xml.xpath2.processor.internal.types;
+package org.eclipse.wst.xml.xpath2.processor.internal.types.xerces;
 
 import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.xerces.dom.PSVIAttrNSImpl;
-import org.apache.xerces.dom.PSVIElementNSImpl;
-import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.XSObjectList;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.xerces.XercesTypeDefinition;
-import org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 public class SimpleXercesTypeDefinition extends XercesTypeDefinition implements SimpleTypeDefinition {
@@ -39,13 +30,13 @@
 		return simpleTypeDefinition.getBuiltInKind();
 	}
 
-	public SimpleTypeDefinition getItemType() {
+	public TypeDefinition getItemType() {
 		return createTypeDefinition(simpleTypeDefinition.getItemType());
 	}
 
-	public List<SimpleTypeDefinition> getMemberTypes() {
+	public List/*<SimpleTypeDefinition>*/ getMemberTypes() {
 		XSObjectList xsMemberTypes = simpleTypeDefinition.getMemberTypes();
-		List<SimpleTypeDefinition> memberTypes = new LinkedList<SimpleTypeDefinition>();
+		List/*<SimpleTypeDefinition>*/ memberTypes = new LinkedList/*<SimpleTypeDefinition>*/();
 		for (int i = 0; i < xsMemberTypes.getLength(); i++) {
 			memberTypes.add(createTypeDefinition((XSSimpleTypeDefinition) xsMemberTypes.item(i)));
 		}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/XercesTypeDefinition.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/XercesTypeDefinition.java
index fc15f81..e76693d 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/XercesTypeDefinition.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/xerces/XercesTypeDefinition.java
@@ -11,9 +11,6 @@
 import org.apache.xerces.xs.XSConstants;
 import org.apache.xerces.xs.XSSimpleTypeDefinition;
 import org.apache.xerces.xs.XSTypeDefinition;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.ComplexXercesTypeDefinition;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleXercesType;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleXercesTypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
@@ -76,21 +73,21 @@
 		return xercesFlags;
 	}
 	
-	public List<Short> getSimpleTypes(Attr attr) {
+	public List/*<Short>*/ getSimpleTypes(Attr attr) {
 		PSVIAttrNSImpl psviAttr= (PSVIAttrNSImpl)attr;
 		return mapList(psviAttr.getItemValueTypes());
 	}
 
-	public List<Short> getSimpleTypes(Element element) {
+	public List/*<Short>*/ getSimpleTypes(Element element) {
 		PSVIElementNSImpl psviElement= (PSVIElementNSImpl)element;
 		return mapList(psviElement.getItemValueTypes());
 	}
 
-	private List<Short> mapList(ShortList valueTypes) {
+	private List/*<Short>*/ mapList(ShortList valueTypes) {
 		if (valueTypes == null) return null;
-		List<Short> types = new LinkedList<Short>();
+		List/*<Short>*/ types = new LinkedList/*<Short>*/();
 		int limit = valueTypes.getLength();
-		for (int i = 0; i < limit; ++i) types.add(valueTypes.item(i));
+		for (int i = 0; i < limit; ++i) types.add(Short.valueOf(valueTypes.item(i)));
 		return types;
 	}
 	
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ComparableTypePromoter.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ComparableTypePromoter.java
index 9373484..278ba26 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ComparableTypePromoter.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ComparableTypePromoter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moller, and others
+ * Copyright (c) 2009, 2010 Jesper Steen Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,11 +7,11 @@
  *
  * Contributors:
  *     Jesper Steen Moller - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.utils;
 
-import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime;
@@ -20,10 +20,9 @@
 
 public class ComparableTypePromoter extends ScalarTypePromoter {
 
-	@Override
-	protected boolean checkCombination(Class<? extends AnyAtomicType> newType) {
+	protected boolean checkCombination(Class newType) {
 
-		Class<? extends AnyAtomicType> targetType = getTargetType();
+		Class targetType = getTargetType();
 		if (newType == XSString.class || newType == XSTime.class || targetType == XSString.class || targetType == XSTime.class) {
 			return targetType == newType;	
 		}
@@ -37,8 +36,7 @@
 		return super.checkCombination(newType);
 	}
 
-	@Override
-	protected Class<? extends AnyAtomicType> substitute(Class<? extends AnyAtomicType> typeToConsider) {
+	protected Class substitute(Class typeToConsider) {
 		if (typeToConsider == XSAnyURI.class || typeToConsider == XSString.class) {
 			return XSString.class;
 		}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/LiteralUtils.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/LiteralUtils.java
index d1f75d8..c90dcc7 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/LiteralUtils.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/LiteralUtils.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Steen M�ller and others.
+ * Copyright (c) 2009, 2010 Jesper Steen M¿ller and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     Jesper Steen Moller - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.utils;
@@ -38,7 +39,7 @@
 			return quotedString.substring(1, inputLength-1);
 		}
 		
-		StringBuilder sb = new StringBuilder();
+		StringBuffer sb = new StringBuffer();
 		for (int i = 1; i < inputLength-1; ++i) {
 			char ch = quotedString.charAt(i);
 			sb.append(ch);
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/NumericTypePromoter.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/NumericTypePromoter.java
index 14248e8..d3d2403 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/NumericTypePromoter.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/NumericTypePromoter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moller, and others
+ * Copyright (c) 2009, 2010 Jesper Steen Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,13 @@
  * Contributors:
  *     Jesper Steen Moller - initial API and implementation
  *     Jesper Steen Moller - bug 281028 - avg/min/max/sum work
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.utils;
 
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
-import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat;
@@ -26,8 +23,7 @@
 
 public class NumericTypePromoter extends TypePromoter {
 
-	@Override
-	protected boolean checkCombination(Class<? extends AnyAtomicType> newType) {
+	protected boolean checkCombination(Class newType) {
 		// Note: Double or float will override everything
 		if (newType == XSDouble.class || getTargetType() == XSDouble.class) {
 			setTargetType(XSDouble.class);
@@ -43,22 +39,20 @@
 		return true;
 	}
 
-	@Override
 	public AnyAtomicType doPromote(AnyAtomicType value) throws DynamicError {
 		if (getTargetType() == XSFloat.class) {
-			return new XSFloat(value.string_value());
+			return new XSFloat(value.getStringValue());
 		} else if (getTargetType() == XSDouble.class) {
-			return new XSDouble(value.string_value());
+			return new XSDouble(value.getStringValue());
 		} else if (getTargetType() == XSInteger.class) {
-			return new XSInteger(value.string_value());
+			return new XSInteger(value.getStringValue());
 		} else if (getTargetType() == XSDecimal.class) {
-			return new XSDecimal(value.string_value());
+			return new XSDecimal(value.getStringValue());
 		}
 		return null;
 	}
 
-	@Override
-	protected Class<? extends AnyAtomicType> substitute(Class<? extends AnyAtomicType> typeToConsider) {
+	protected Class substitute(Class typeToConsider) {
 		if (typeToConsider == XSUntypedAtomic.class) return XSDouble.class;
 		if (isDerivedFrom(typeToConsider, XSFloat.class)) return XSFloat.class;
 		if (isDerivedFrom(typeToConsider, XSDouble.class)) return XSDouble.class;
@@ -67,7 +61,7 @@
 		return null;
 	}
 
-	private boolean isDerivedFrom(Class<? extends AnyType> typeToConsider, Class<? extends AnyType> superType) {
+	private boolean isDerivedFrom(Class typeToConsider, Class superType) {
 		return superType.isAssignableFrom(typeToConsider);
 	}
 	
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ScalarTypePromoter.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ScalarTypePromoter.java
index 5177d81..4909d30 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ScalarTypePromoter.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/ScalarTypePromoter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moller, and others
+ * Copyright (c) 2009, 2010 Jesper Steen Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,28 +7,26 @@
  *
  * Contributors:
  *     Jesper Steen Moller - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.utils;
 
-import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration;
 
 public class ScalarTypePromoter extends NumericTypePromoter {
 
-	@Override
-	protected boolean checkCombination(Class<? extends AnyAtomicType> newType) {
+	protected boolean checkCombination(Class newType) {
 
-		Class<? extends AnyAtomicType> targetType = getTargetType();
+		Class targetType = getTargetType();
 		if (targetType == XSDayTimeDuration.class || targetType == XSYearMonthDuration.class) {
 			return targetType == newType;	
 		}
 		return super.checkCombination(newType);
 	}
 
-	@Override
-	protected Class<? extends AnyAtomicType> substitute(Class<? extends AnyAtomicType> typeToConsider) {
+	protected Class substitute(Class typeToConsider) {
 		if (typeToConsider == XSDayTimeDuration.class || typeToConsider == XSYearMonthDuration.class) {
 			return typeToConsider;
 		}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/StringCodePointIterator.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/StringCodePointIterator.java
index b409b3b..340c51f 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/StringCodePointIterator.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/StringCodePointIterator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller and others.
+ * Copyright (c) 2009, 2010 Jesper Steen Moeller and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,10 +7,13 @@
  *
  * Contributors:
  *     Jesper Steen Moeller - bug 282096 - initial API and implementation
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
  
 package org.eclipse.wst.xml.xpath2.processor.internal.utils;
 
+import com.ibm.icu.lang.UCharacter;
+
 public final class StringCodePointIterator implements CodePointIterator
 {
     private String text;
@@ -29,7 +32,7 @@
         
         this.text = text;
         this.end = text.length();
-        if (end > 0 && Character.isHighSurrogate(text.charAt(end-1)))
+        if (end > 0 && UCharacter.isHighSurrogate(text.charAt(end-1)))
             throw new IllegalArgumentException("Invalid UTF-16 sequence ending with a high surrogate");
        
         this.pos = 0;
@@ -72,7 +75,7 @@
     public int last()
     {
         pos = end;
-        cpPos = Character.codePointCount(text, 0, pos);
+        cpPos = UCharacter.codePointCount(text, 0, pos);
         return previous();
      }
 
@@ -84,7 +87,9 @@
     {
         if (pos < end) {
             char ch1 =  text.charAt(pos);
-            if (Character.isHighSurrogate(ch1)) return Character.toCodePoint(ch1, text.charAt(pos+1));
+            if (UCharacter.isHighSurrogate(ch1)) 
+               return UCharacter.toCodePoint(ch1, text.charAt(pos+1));
+            
             return ch1;
         }
         else {
@@ -100,7 +105,7 @@
     {
         if (pos < end - 1) {
             pos++;
-            if (Character.isLowSurrogate(text.charAt(pos))) pos++;
+            if (UCharacter.isLowSurrogate(text.charAt(pos))) pos++;
             cpPos++;
             return current();
         }
@@ -118,7 +123,7 @@
     {
         if (pos > 0) {
             pos--;
-            if (Character.isLowSurrogate(text.charAt(pos))) pos--; 
+            if (UCharacter.isLowSurrogate(text.charAt(pos))) pos--; 
             cpPos--;
             return current();
         }
@@ -142,7 +147,6 @@
      * @return true if the given obj is the same as this
      * StringCodePointIterator object; false otherwise.
      */
-    @Override
 	public boolean equals(Object obj)
     {
         if (this == obj)
@@ -165,7 +169,6 @@
      * Computes a hashcode for this iterator.
      * @return A hash code
      */
-    @Override
 	public int hashCode()
     {
         return text.hashCode() ^ pos ^ end;
@@ -175,7 +178,6 @@
      * Creates a copy of this iterator.
      * @return A copy of this
      */
-    @Override
 	public Object clone()
     {
         try {
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/TypePromoter.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/TypePromoter.java
index 01d743a..b801589 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/TypePromoter.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/TypePromoter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moller, and others
+ * Copyright (c) 2009, 2010 Jesper Steen Moller, and others
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,14 +8,17 @@
  * Contributors:
  *     Jesper Steen Moller - initial API and implementation
  *     Jesper Steen Moller - bug 281028 - avg/min/max/sum work
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
  *******************************************************************************/
 
 package org.eclipse.wst.xml.xpath2.processor.internal.utils;
 
 import java.util.Collection;
+import java.util.Iterator;
 
 import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
+import org.eclipse.wst.xml.xpath2.api.Item;
+import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
 import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
@@ -24,7 +27,7 @@
  * Generic type promoter for handling subtype substitution and type promotions for functions and operators.
  */
 public abstract class TypePromoter {
-	private Class<? extends AnyAtomicType> targetType = null;
+	private Class targetType = null;
 
 	abstract public AnyAtomicType doPromote(AnyAtomicType value) throws DynamicError;	
 
@@ -39,12 +42,12 @@
 	 * @param typeToConsider The 
 	 * @return The supertype to treat it as (i.e. if a xs:nonNegativeInteger is treated as xs:number)
 	 */
-	abstract protected Class<? extends AnyAtomicType> substitute(Class<? extends AnyAtomicType> typeToConsider);	
+	abstract protected Class substitute(Class typeToConsider);	
 
-	abstract protected boolean checkCombination(Class<? extends AnyAtomicType> newType);
+	abstract protected boolean checkCombination(Class newType);
 		
-	public void considerType(Class<? extends AnyAtomicType> typeToConsider) throws DynamicError {
-		Class<? extends AnyAtomicType> baseType = substitute(typeToConsider);
+	public void considerType(Class typeToConsider) throws DynamicError {
+		Class baseType = substitute(typeToConsider);
 		
 		if (baseType == null) {
 			throw DynamicError.argument_type_error(typeToConsider);
@@ -59,28 +62,28 @@
 		}
 	}
 	
-	public void considerTypes(Collection<Class<? extends AnyAtomicType>> typesToConsider) throws DynamicError {
-		for (Class<? extends AnyAtomicType> type : typesToConsider) {
-			considerType(type);
+	public void considerTypes(Collection typesToConsider) throws DynamicError {		
+		for (Iterator iter = typesToConsider.iterator(); iter.hasNext();) {
+			considerType((Class)iter.next());	
 		}
 	}
 	
 	public void considerSequence(ResultSequence sequenceToConsider) throws DynamicError {
 		for (int i = 0; i < sequenceToConsider.size(); ++i) {
-			AnyType item = sequenceToConsider.get(i);
+			Item item = sequenceToConsider.item(i);
 			considerValue(item);
 		}
 	}
 	
-	public Class<? extends AnyAtomicType> getTargetType() {
+	public Class getTargetType() {
 		return targetType;
 	}
 	
-	protected void setTargetType(Class<? extends AnyAtomicType> class1) {
+	protected void setTargetType(Class class1) {
 		this.targetType = class1;
 	}
 
-	public AnyAtomicType atomize(AnyType at) {
+	public AnyAtomicType atomize(Item at) {
 		if (at instanceof NodeType) {
 			return (AnyAtomicType)((NodeType)at).typed_value().first();
 		}
@@ -89,7 +92,7 @@
 		}
 	}
 	
-	public void considerValue(AnyType at) throws DynamicError {
+	public void considerValue(Item at) throws DynamicError {
 		considerType(atomize(at).getClass());
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/ContextBuilder.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/ContextBuilder.java
deleted file mode 100644
index 2b5c06b..0000000
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/ContextBuilder.java
+++ /dev/null
@@ -1,414 +0,0 @@
-package org.eclipse.wst.xml.xpath2.processor.util;
-//package org.eclipse.wst.xml.xpath2;
-//
-//import java.io.FileNotFoundException;
-//import java.io.IOException;
-//import java.net.MalformedURLException;
-//import java.net.URI;
-//import java.net.URL;
-//import java.util.Collection;
-//import java.util.Comparator;
-//import java.util.GregorianCalendar;
-//import java.util.HashMap;
-//import java.util.Map;
-//import java.util.TimeZone;
-//
-//import javax.xml.namespace.NamespaceContext;
-//import javax.xml.namespace.QName;
-//
-//import org.apache.xerces.xs.XSModel;
-//import org.eclipse.wst.xml.xpath2.api.CollationProvider;
-//import org.eclipse.wst.xml.xpath2.api.DynamicContext;
-//import org.eclipse.wst.xml.xpath2.api.Function;
-//import org.eclipse.wst.xml.xpath2.api.ResultSequence;
-//import org.eclipse.wst.xml.xpath2.api.StaticContext;
-//import org.eclipse.wst.xml.xpath2.api.types.DocType;
-//import org.eclipse.wst.xml.xpath2.api.types.NodeType;
-//import org.eclipse.wst.xml.xpath2.api.types.XSDuration;
-//import org.eclipse.wst.xml.xpath2.api.types.XSQName;
-//import org.eclipse.wst.xml.xpath2.api.typesystem.DOMTypeProvider;
-//import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
-//import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
-//import org.eclipse.wst.xml.xpath2.processor.DOMLoader;
-//import org.eclipse.wst.xml.xpath2.processor.DOMLoaderException;
-//import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-//import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
-//import org.eclipse.wst.xml.xpath2.processor.XercesLoader;
-//import org.eclipse.wst.xml.xpath2.processor.internal.Focus;
-//import org.eclipse.wst.xml.xpath2.processor.internal.function.AbstractFunction;
-//import org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary;
-//import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
-//import org.eclipse.wst.xml.xpath2.processor.internal.types.xerces.XercesTypeModel;
-//import org.w3c.dom.Document;
-//import org.w3c.dom.Node;
-//
-///**
-// * The default implementation of a Dynamic Context.
-// * 
-// * Initializes and provides functionality of a dynamic context according to the
-// * XPath 2.0 specification.
-// */
-//public class ContextBuilder implements StaticContext, DynamicContext {
-//
-//	private ResultSequence _focus;
-//	private org.eclipse.wst.xml.xpath2.api.types.XSDuration _tz;
-//	private Map _loaded_documents;
-//	private GregorianCalendar _current_date_time;
-//	private String _default_collation_name = CODEPOINT_COLLATION;
-//	private CollationProvider _collation_provider;
-//
-//	/**
-//	 * Constructor.
-//	 * 
-//	 * @param schema
-//	 *            Schema information of document. May be null
-//	 * @param doc
-//	 *            Document [root] node of XML source.
-//	 */
-//	public ContextBuilder(XSModel schema, Document doc) {
-//		this(new XercesTypeModel(schema));
-//	}
-//
-//	/**
-//	 * Constructor.
-//	 * 
-//	 * @param schema
-//	 *            Schema information of document. May be null
-//	 * @param doc
-//	 *            Document [root] node of XML source.
-//	 * @since 1.2
-//	 */
-//	public ContextBuilder(TypeModel schema) {
-//
-//		_focus = null;
-//		_tz = new XSDayTimeDurationImpl(0, 5, 0, 0, true);
-//		_loaded_documents = new HashMap();
-//	}
-//	/**
-//	 * Reads the day from a TimeDuration type
-//	 * 
-//	 * @return an xs:integer _tz
-//	 * @since 1.1
-//	 */
-//	public XSDuration getTimezoneOffset() {
-//		return _tz;
-//	}
-//
-//	/**
-//	 * Gets the Current stable date time from the dynamic context.
-//	 * @since 1.1
-//	 * @see org.eclipse.wst.xml.xpath2.api.DynamicContext#get_current_time()
-//	 */
-//	public GregorianCalendar getCurrentDateTime() {
-//		if (_current_date_time == null) {
-//			_current_date_time = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
-//		}
-//		return _current_date_time;
-//	}
-//	
-//	/**
-//	 * Changes the current focus.
-//	 * 
-//	 * @param f
-//	 *            focus to set
-//	 */
-//	public void set_focus(Focus f) {
-//		_focus = f;
-//	}
-//
-//	/**
-//	 * Return the focus
-//	 * 
-//	 * @return _focus
-//	 */
-//	public Focus focus() {
-//		return _focus;
-//	}
-//
-//	/**
-//	 * Retrieve context item that is in focus
-//	 * 
-//	 * @return an AnyType result from _focus.context_item()
-//	 */
-//	public AnyType getContextItem() {
-//		return _focus.context_item();
-//	}
-//
-//	/**
-//	 * Retrieve the position of the focus
-//	 * 
-//	 * @return an integer result from _focus.position()
-//	 */
-//	public int context_position() {
-//		return _focus.position();
-//	}
-//
-//	/**
-//	 * Retrieve the position of the last focus
-//	 * 
-//	 * @return an integer result from _focus.last()
-//	 */
-//	public int last() {
-//		return _focus.last();
-//	}
-//
-//	public Object getVariable(XSQName name) {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//	
-//	/**
-//	 * Retrieve the variable name
-//	 * 
-//	 * @return an AnyType result from get_var(name) or return NULL
-//	 * @since 1.2
-//	 */
-//	public Object get_variable2(XSQName name) {
-//		// XXX: built-in variables
-//		if ("fs".equals(name.prefix())) {
-//			if (name.local().equals("dot"))
-//				return getContextItem();
-//
-//			return null;
-//		}
-//		return get_var(name);
-//	}
-//
-//	/**
-//	 * 
-//	 * @return a ResultSequence from funct.evaluate(args)
-//	 */
-//	public ResultSequence evaluateFunction(XSQName name, Collection args)
-//			throws DynamicError {
-//		AbstractFunction funct = function(name, args.size());
-//
-//		assert funct != null;
-//
-//		return funct.evaluate(args);
-//	}
-//
-//	/**
-//	 * Adds function definitions.
-//	 * 
-//	 * @param fl
-//	 *            Function library to add.
-//	 * 
-//	 */
-//	@Override
-//	public void add_function_library(FunctionLibrary fl) {
-//		super.add_function_library(fl);
-//		fl.set_dynamic_context(this);
-//	}
-//
-//	/**
-//	 * get document
-//	 * 
-//	 * @return a ResultSequence from ResultSequenceFactory.create_new()
-//	 * @since 1.1
-//	 */
-//	public ResultSequence getDocument(URI resolved) {
-//		Document doc = null;
-//		if (_loaded_documents.containsKey(resolved)) {
-//			 //tried before
-//			doc = (Document)_loaded_documents.get(resolved);
-//		} else {
-//			doc = retrieve_doc(resolved);
-//			_loaded_documents.put(resolved, doc);
-//		}
-//
-//		if (doc == null)
-//			return null;
-//
-//		return ResultSequenceFactory.create_new(new DocType(doc, getTypeModel(doc)));
-//	}
-//	/**
-//	 * @since 1.1
-//	 */
-//	public URI resolveUri(String uri) {
-//		try {
-//			URI realURI = URI.create(uri);
-//			if (realURI.isAbsolute()) {
-//				return realURI;
-//			} else {
-//				URI baseURI = URI.create(base_uri().getStringValue());
-//				return baseURI.resolve(uri);
-//			}
-//		} catch (IllegalArgumentException iae) {
-//			return null;
-//		}
-//	}
-//
-//	// XXX make it nice, and move it out as a utility function
-//	private Document retrieve_doc(URI uri) {
-//		try {
-//			DOMLoader loader = new XercesLoader();
-//			loader.set_validating(false);
-//
-//			Document doc = loader.load(new URL(uri.toString()).openStream());
-//			doc.setDocumentURI(uri.toString());
-//			return doc;
-//		} catch (DOMLoaderException e) {
-//			return null;
-//		} catch (FileNotFoundException e) {
-//			return null;
-//		} catch (MalformedURLException e) {
-//			return null;
-//		} catch (IOException e) {
-//			return null;
-//		}
-//	}
-//
-//	/**
-//	 * Sets the value of a variable.
-//	 * 
-//	 * @param var
-//	 *            Variable name.
-//	 * @param val
-//	 *            Variable value.
-//	 */
-//	@Override
-//	public void set_variable(XSQName var, AnyType val) {
-//		super.set_variable(var, val);
-//	}
-//	
-//	
-//	/*
-//	 * Set a XPath2 sequence into a variable.
-//	 */
-//	/**
-//	 * @since 1.2
-//	 */
-//	public void set_variable(XSQName var, ResultSequence val) {
-//		super.set_variable(var, val);
-//	}
-//
-//	/**
-//	 * @since 1.1
-//	 */
-//	public void set_default_collation(String _default_collation) {
-//		this._default_collation_name = _default_collation;
-//	}
-//
-//	/**
-//	 * @since 1.1
-//	 */
-//	public String getDefaultCollationName() {
-//		return _default_collation_name;
-//	}
-//
-//	// We are explicitly NOT using generics here, in anticipation of JDK1.4 compatibility
-//	private static Comparator CODEPOINT_COMPARATOR = new Comparator() {
-//		
-//		public int compare(Object o1, Object o2) {
-//			return ((String)o1).compareTo((String)o2);
-//		}
-//	};
-//	
-//	/**
-//	 * @since 1.1
-//	 * 
-//	 */
-//	public Comparator<Object> get_collation(String uri) {
-//		if (CODEPOINT_COLLATION.equals(uri)) return CODEPOINT_COMPARATOR;
-//		
-//		return _collation_provider != null ? _collation_provider.get_collation(uri) : null;
-//	}
-//	
-//	/**
-//	 * 
-//	 * 
-//	 * @param provider
-//	 * @since 1.1
-//	 */
-//	public void set_collation_provider(CollationProvider provider) {
-//		this._collation_provider = provider;
-//	}
-//	
-//	/**
-//	 * Use focus().position() to retrieve the value.
-//	 * @deprecated  This will be removed in a future version use focus().position().
-//	 */
-//	@Deprecated
-//	public int node_position(Node node) {
-//	  // unused parameter!
-//	  return _focus.position();	
-//	}
-//	
-//	/**
-//	 * @since 1.2
-//	 */
-//	@Override
-//	public TypeModel getTypeModel(Node node) {
-//		return super.getTypeModel(node);
-//	}
-//
-//	public NodeType getLimitNode() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public ResultSequence getVariable(QName name) {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public ResultSequence evaluateFunction(String name, Collection args) {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public DocType getDocument(String uri) {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public boolean isXPath1Compatible() {
-//		// TODO Auto-generated method stub
-//		return false;
-//	}
-//
-//	public TypeDefinition getInitialContextType() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public NamespaceContext getNamespaceContext() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public String getDefaultNamespace() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public String getDefaultFunctionNamespace() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public DOMTypeProvider getTypeProvider() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public Function resolveFunction(String name, int arity) {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public URI getBaseUri() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public Collection getFunctionLibraries() {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//
-//	public TypeDefinition getCollectionType(String collectionName) {
-//		// TODO Auto-generated method stub
-//		return null;
-//	}
-//}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/DynamicContextBuilder.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/DynamicContextBuilder.java
index 0c1b97b..ee8ba75 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/DynamicContextBuilder.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/DynamicContextBuilder.java
@@ -1,8 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2011, Jesper Steen Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moller - initial API and implementation
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *     Jesper Steen Moller - bug 343804 - Updated API information
+ *******************************************************************************/
+
 package org.eclipse.wst.xml.xpath2.processor.util;
 
-import java.util.Collection;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
 
@@ -11,17 +29,24 @@
 import javax.xml.datatype.Duration;
 import javax.xml.namespace.QName;
 
+import org.eclipse.wst.xml.xpath2.api.CollationProvider;
 import org.eclipse.wst.xml.xpath2.api.DynamicContext;
 import org.eclipse.wst.xml.xpath2.api.ResultSequence;
 import org.eclipse.wst.xml.xpath2.api.StaticContext;
+import org.eclipse.wst.xml.xpath2.processor.DOMLoader;
+import org.eclipse.wst.xml.xpath2.processor.XercesLoader;
+import org.eclipse.wst.xml.xpath2.processor.internal.function.FnCollection;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
+
 /**
  * An implementation of a Dynamic Context.
  * 
  * Initializes and provides functionality of a dynamic context according to the
  * XPath 2.0 specification.
+ * 
+ * @since 2.0
  */
 public class DynamicContextBuilder implements DynamicContext {
 
@@ -34,12 +59,21 @@
 			throw new RuntimeException("Cannot initialize XML datatypes", e);
 		}
 	}
-	private Duration _tz = _datatypeFactory.newDuration(0);
-	private Map/*<String, DocType>*/ documents;
+	private TimeZone _systemTimezone = TimeZone.getDefault();
+	
+	private Duration _tz = _datatypeFactory.newDuration(_systemTimezone.getRawOffset());
 	private GregorianCalendar _currentDateTime;
 	
-	private Map/*<QName,ResultSequence>*/ _variables = new HashMap/*<QName,ResultSequence>*/();
-	private StaticContext _staticContext;
+	private Map<QName,ResultSequence> _variables = new HashMap<QName,ResultSequence>();
+	private final StaticContext _staticContext;
+
+	private Map<String, List<Document>> _collections;
+
+	private Map<URI, Document> _loaded_documents = new HashMap<URI, Document>();
+
+	public DynamicContextBuilder(StaticContext sc) {
+		_staticContext = sc;
+	}
 	
 	/**
 	 * Reads the day from a TimeDuration type
@@ -65,37 +99,74 @@
 	}
 
 	public ResultSequence getVariable(QName name) {
-		return (ResultSequence) _variables.get(name);
+		return _variables.get(name);
 	}
 
-	public ResultSequence evaluateFunction(QName name, Collection args) {
-		
-		// TODO Auto-generated method stub
-		return null;
+	public Document getDocument(URI resolved) {
+		Document doc = null;
+		if (_loaded_documents.containsKey(resolved)) {
+			 //tried before
+			doc = _loaded_documents.get(resolved);
+		} else {
+			doc = retrieve_doc(resolved);
+			_loaded_documents.put(resolved, doc);
+		}
+		return doc;
 	}
 
-	public Document getDocument(String uri) {
-		// TODO Auto-generated method stub
-		return null;
+	// XXX make it nice, and move it out as a utility function
+	private Document retrieve_doc(URI uri) {
+		try {
+			DOMLoader loader = new XercesLoader();
+			loader.set_validating(false);
+
+			Document doc = loader.load(new URL(uri.toString()).openStream());
+			doc.setDocumentURI(uri.toString());
+			return doc;
+		} catch (FileNotFoundException e) {
+			return null;
+		} catch (MalformedURLException e) {
+			return null;
+		} catch (IOException e) {
+			return null;
+		}
 	}
 
-	public String resolveUri(String uri) {
-		return uri;
+	public URI resolveUri(String uri) {
+		try {
+			URI realURI = URI.create(uri);
+			if (realURI.isAbsolute()) {
+				return realURI;
+			}
+			return _staticContext.getBaseUri().resolve(uri);
+		} catch (IllegalArgumentException iae) {
+			return null;
+		}
 	}
 
-	public DynamicContextBuilder withStaticContext(StaticContext sc) {
-		_staticContext = sc;
+	public Map<String, List<Document>> getCollections() {
+		return _collections;
+	}
+
+	public List<Document> getDefaultCollection() {
+		return getCollections().get(FnCollection.DEFAULT_COLLECTION_URI);
+	}
+
+	public DynamicContextBuilder withVariable(javax.xml.namespace.QName qName, ResultSequence values) {
+		this._variables.put(qName, values);
+		return this;
+	}
+	
+	public DynamicContextBuilder withTimezoneOffset(Duration d) {
+		this._tz = d;
 		return this;
 	}
 
-	public Map getCollections() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public ResultSequence getDefaultCollection() {
-		// TODO Auto-generated method stub
-		return null;
+	public void withCollections(Map<String, List<Document>> map) {
+		this._collections = map;
 	}
 	
+	public CollationProvider getCollationProvider() {
+		return _staticContext.getCollationProvider();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/ResultSequenceUtil.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/ResultSequenceUtil.java
new file mode 100644
index 0000000..a8959ea
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/ResultSequenceUtil.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011, Jesper Steen Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moller - initial API and implementation
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *     Jesper Steen Moller - bug 343804 - Updated API information
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.processor.util;
+
+import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+
+/**
+ * Introduced, but deprecated since it deals with old-style ResultSequences.
+ * 
+ * @since 2.0
+ */
+@SuppressWarnings("deprecation")
+public class ResultSequenceUtil {
+
+	public static ResultSequence newToOld(
+			org.eclipse.wst.xml.xpath2.api.ResultSequence result) {
+		if (result instanceof ResultSequence) 
+			return (ResultSequence)result;
+		
+		ResultSequence rs = ResultSequenceFactory.create_new();
+		for (int i = 0; i < result.size(); ++i) {
+			rs.add((AnyType) result.item(i));
+		}
+		return rs;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/StaticContextBuilder.java b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/StaticContextBuilder.java
index e8731ae..43cf005 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/StaticContextBuilder.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/util/StaticContextBuilder.java
@@ -1,7 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2011, Jesper Steen Moller, and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moller - initial API and implementation
+ *     Jesper Steen Moller  - bug 340933 - Migrate to new XPath2 API
+ *     Jesper Steen Moller - bug 343804 - Updated API information
+ *******************************************************************************/
+
 package org.eclipse.wst.xml.xpath2.processor.util;
 
 import java.net.URI;
-import java.util.Collection;
+import java.net.URISyntaxException;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -11,6 +24,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 
@@ -19,10 +33,17 @@
 import org.eclipse.wst.xml.xpath2.api.FunctionLibrary;
 import org.eclipse.wst.xml.xpath2.api.StaticContext;
 import org.eclipse.wst.xml.xpath2.api.StaticVariableResolver;
+import org.eclipse.wst.xml.xpath2.api.typesystem.ItemType;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition;
 import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
+import org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary;
+import org.eclipse.wst.xml.xpath2.processor.function.XSCtrLibrary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary;
 import org.w3c.dom.Node;
 
+/**
+ * @since 2.0
+ */
 public class StaticContextBuilder implements StaticContext {
 
 	public static final String XPATH_FUNCTIONS_NS = "http://www.w3.org/2005/xpath-functions";
@@ -31,15 +52,19 @@
 	private String _default_namespace = "";
 	private String _default_function_namespace = XPATH_FUNCTIONS_NS;
 	private TypeDefinition _initialContextType = null; 
+	private String _defaultCollation = CollationProvider.CODEPOINT_COLLATION;
 
 	// key: String prefix, contents: String namespace
 	private Map/*<String, String>*/ _namespaces = new HashMap/*<String, String>*/();
-	private Map/*<String, FunctionLibrary>*/ _functionLibraries;
-	private boolean _useDefaultLibraries = true;
+	private Map<String, FunctionLibrary> _functionLibraries = new HashMap<String, FunctionLibrary>();
+	{
+		_functionLibraries.put(XPATH_FUNCTIONS_NS, new FnFunctionLibrary());
+		_functionLibraries.put(XSCtrLibrary.XML_SCHEMA_NS, new XSCtrLibrary());
+	}
 
 	private URI _base_uri;
-	private Map/*<String, TypeDefinition>*/ _documents = new HashMap/*<String, TypeDefinition>*/();
 	private Map/*<String, TypeDefinition>*/ _variableTypes = new HashMap/*<String, TypeDefinition>*/();
+	private Map/*<String, Short>*/ _variableCardinality = new HashMap/*<String, Short>*/();
 	private Map/*<String, TypeDefinition>*/ _collectionTypes = new HashMap/*<String, TypeDefinition>*/();
 
 	private Set/*<QName>*/ _hiddenFunctions = new HashSet/*<QName>*/();
@@ -74,7 +99,9 @@
 			}
 			
 			public String getNamespaceURI(String prefix) {
-				return (String)_namespaces.get(prefix);
+				String ns = (String)_namespaces.get(prefix);
+				if (ns == null) ns = XMLConstants.NULL_NS_URI;
+				return ns;
 			}
 		};
 	}
@@ -111,7 +138,7 @@
 
 	public Function resolveFunction(QName name, int arity) {
 		if (_hiddenFunctions.contains(name)) return null;
-		FunctionLibrary flib = (FunctionLibrary) _functionLibraries.get(name.getNamespaceURI());
+		FunctionLibrary flib = _functionLibraries.get(name.getNamespaceURI());
 		if (flib != null) {
 			return flib.resolveFunction(name.getLocalPart(), arity);
 		}
@@ -122,8 +149,8 @@
 		return _base_uri;
 	}
 
-	public Collection getFunctionLibraries() {
-		return _functionLibraries.values();
+	public Map<String, FunctionLibrary> getFunctionLibraries() {
+		return _functionLibraries;
 	}
 
 	public TypeDefinition getCollectionType(String collectionName) {
@@ -158,15 +185,27 @@
 		_hiddenFunctions.add(functionToSuppress);
 		return this;
 	}
+	public StaticContextBuilder withoutFunction(QName ... functionsToSuppress) {
+		for (QName name : functionsToSuppress)
+			_hiddenFunctions.add(name);
+		return this;
+	}
 	
 	public TypeDefinition getDefaultCollectionType() {
-		// TODO Auto-generated method stub
-		return null;
+		return BuiltinTypeLibrary.XS_UNTYPED;
 	}
 
 	public StaticVariableResolver getInScopeVariables() {
-		// TODO Auto-generated method stub
-		return null;
+		return new StaticVariableResolver() {
+
+			public boolean isVariablePresent(QName name) {
+				return _variableTypes.containsKey(name);
+			}
+
+			public ItemType getVariableType(QName name) {
+				return (ItemType) _variableTypes.get(name);
+			}
+		};
 	}
 
 	// We are explicitly NOT using generics here, in anticipation of JDK1.4 compatibility
@@ -180,7 +219,7 @@
 	private CollationProvider _collationProvider = new CollationProvider() {
 		
 		public String getDefaultCollation() {
-			return CollationProvider.CODEPOINT_COLLATION;
+			return _defaultCollation;
 		}
 		
 		public Comparator getCollation(String uri) {
@@ -188,7 +227,7 @@
 			return null;
 		}
 	};
-	
+
 	public CollationProvider getCollationProvider() {
 		return _collationProvider;
 	}
@@ -197,4 +236,31 @@
 		_collationProvider = cp;
 		return this;
 	}
+
+	public StaticContextBuilder withVariable(javax.xml.namespace.QName qName,
+			ItemType type) {
+		_variableTypes.put(qName, type);
+		return this;
+	}
+
+	public StaticContextBuilder withBaseUri(String string) throws URISyntaxException {
+		_base_uri = new URI(string);		
+		return this;
+	}
+
+	public StaticContextBuilder withFunctionLibrary(
+			String namespace,
+			FunctionLibrary fl) {
+		_functionLibraries.put(namespace, fl);
+		return this;
+	}
+
+	public StaticContextBuilder withDefaultCollation(String uri) {
+		this._defaultCollation = uri;
+		return this;
+	}
+
+	public ItemType getDocumentType(URI documentUri) {
+		return null;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.xpath2.wtptypes/src/org/eclipse/wst/xml/xpath2/wtptypes/XsdDOMTypeProvider.java b/bundles/org.eclipse.wst.xml.xpath2.wtptypes/src/org/eclipse/wst/xml/xpath2/wtptypes/XsdDOMTypeProvider.java
index 6f801d1..a44cd70 100644
--- a/bundles/org.eclipse.wst.xml.xpath2.wtptypes/src/org/eclipse/wst/xml/xpath2/wtptypes/XsdDOMTypeProvider.java
+++ b/bundles/org.eclipse.wst.xml.xpath2.wtptypes/src/org/eclipse/wst/xml/xpath2/wtptypes/XsdDOMTypeProvider.java
@@ -221,7 +221,6 @@
 			}
 
 			public Class getNativeType() {
-				// TODO Auto-generated method stub
 				return null;
 			}
 		
@@ -231,14 +230,11 @@
 	static boolean isDerivedFrom(XSDTypeDefinition base, XSDTypeDefinition derived, short derivationMethod) {
 		if (base == derived) return true;
 		
-		
-		
 		// TODO: Check flags
 		return false;
 	}
 
 	public TypeModel getTypeModel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.xpath2/pom.xml b/bundles/org.eclipse.wst.xml.xpath2/pom.xml
deleted file mode 100644
index 1ad4bb1..0000000
--- a/bundles/org.eclipse.wst.xml.xpath2/pom.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-        <modelVersion>4.0.0</modelVersion>
-        <parent>
-           <groupId>org.eclipse.wst.xml.xpath2</groupId>
-           <artifactId>org.eclipse.wst.xml.xpath2-parent</artifactId>
-           <version>2.0.0-SNAPSHOT</version>
-           <relativePath>../../development/athena/org.eclipse.wst.xml.xpath2.releng</relativePath>
-        </parent>
-
-        <artifactId>org.eclipse.wst.xml.xpath2</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <packaging>eclipse-plugin</packaging>
-        <name>PsychoPath XPath 2.0 Processor: Branding Plug-in</name>
-</project>
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/META-INF/MANIFEST.MF
index c6f3063..d61d9da 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.xpath2.processor.doc.user;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
 Bundle-Vendor: %vendorName
 Require-Bundle: org.eclipse.core.runtime
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/docbook/usermanual.xml b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/docbook/usermanual.xml
index 1caf578..45a3c18 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/docbook/usermanual.xml
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/docbook/usermanual.xml
@@ -1,423 +1,253 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<?xml version='1.0' ?><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
 <book>
-  <title>XPath 2.0 Processor User Manual</title>
-
-  <chapter id="Introduction">
-    <title>Introduction</title>
-
-    <para>What is PsychohPath? PsychoPath is a XPath 2.0 XML Schema Aware
-    processor. It is nearly fully compliant to the XPath 2.0 test suite. It is
-    a library that does not require eclipse to be used. Known adopters of
-    PsychoPath include the Xerces-J project for XML Schemas 1.1 assertion
-    support.</para>
-
-    <para>PsychoPath is the only known open-source java XPath 2.0 processor
-    that is fully schema aware. SAXON HE only supports the core functionality.
-    XML Schema awarness provides tighter static checking, and can be used to
-    help determine if certain operations can or should occur on an XML node.
-    For a detailed description of the PsychoPath's design please see the
-    <ulink url="/PsychoPathXPathProcessor/Design">design</ulink>
-    document.</para>
-
-    <section id="Getting_PsychoPath">
-      <title>Getting PsychoPath</title>
-
-      <para>Currently there is no standalone build of PsychoPath. However, you
-      can download the <ulink
-      url="http://download.eclipse.org/webtools/downloads/drops/R3.1/R-3.1-20090616035105/">WTP
-      WST 3.1</ulink> zip file, and use the
-      org.eclipse.wst.xml.xpath2.processor.jar file. This jar has no
-      dependencies on eclipse, and will work as a standard jar file. If you
-      are using an OSGI container, then this is treated as a standard OSGI
-      bundle.</para>
-
-      <tip>
-        <title>PsychoPath 1.1M1</title>
-
-        <para>PsychoPath 1.1M1 is also available to <ulink
-        url="http://download.eclipse.org/webtools/downloads/drops/R3.2/S-3.2M1b-20090814143519/">download</ulink>.
-        1.1M1 passes 96% of the XPath 2.0 test suite.</para>
-      </tip>
-
-      <para>Additional dependencies you currently need are:</para>
-
-      <itemizedlist>
-        <listitem>
-          <para>IBM ICU 4.0 or greater</para>
-        </listitem>
-
-        <listitem>
-          <para>Xerces 2.8.0 or greater</para>
-        </listitem>
-
-        <listitem>
-          <para>JavaCup 0.10 or greater.</para>
-        </listitem>
-      </itemizedlist>
-
-      <para>If using eclipse, these are all available from the Orbit project.
-      Others can find the necessary jars from their respective project
-      pages.</para>
-    </section>
-  </chapter>
-
-  <chapter id="How_to_feed_Psychopath_XPath_expressions">
-    <title>Using PsychoPath XPath 2.0 API</title>
-
-    <para>Since PsychoPath has been implemented as an external library and not
-    as a complete program, in order to use it, it needs to be accessed from
-    inside another program. To process XPath 2.0 expressions using PsychoPath
-    from another programs one needs to go through the following
-    process:</para>
-
-    <orderedlist>
-      <listitem>
-        <para>Load the XML document</para>
-      </listitem>
-
-      <listitem>
-        <para>Optionally validate the XML document</para>
-      </listitem>
-
-      <listitem>
-        <para>Initialize static and dynamic context in respect to the document
-        root</para>
-      </listitem>
-
-      <listitem>
-        <para>Parse the XPath 2.0 expression</para>
-      </listitem>
-
-      <listitem>
-        <para>Statically verify the XPath 2.0 expression</para>
-      </listitem>
-
-      <listitem>
-        <para>Evaluate the XPath 2.0 expression in respect to the XML
-        document</para>
-      </listitem>
-    </orderedlist>
-
-    <para>To give a better idea of how this process actually works, we’ll go
-    through an example of processing and evaluating the string expression
-    “Hello World!”. In this example the XML document that we load is called
-    “XPexample.xml”.</para>
-
-    <section id="Non-Schema_Aware">
-      <title>Non-Schema Aware</title>
-
-      <programlisting>/**
- * First load and optionally validate the XML document 
+	<title>usermanual</title>
+	<chapter id="Introduction">
+		<title>Introduction</title>
+		<para>What is PsychohPath?   PsychoPath is a XPath 2.0 XML Schema Aware processor.  It is nearly fully compliant to the XPath 2.0 test suite.  It is a library that does not require eclipse to be used.   Known adopters of PsychoPath include the Xerces-J project for XML Schemas 1.1 assertion support.</para>
+		<para>PsychoPath is the only known open-source java XPath 2.0 processor that is fully schema aware.   SAXON HE only supports the core functionality.   XML Schema awarness provides tighter static checking, and can be used to help determine if certain operations can or should occur on an XML node.   For a detailed description of the PsychoPath's design please see the 
+			<ulink url="/wiki/PsychoPathXPathProcessor/Design">design</ulink> document.
+		</para>
+		<section id="Getting_PsychoPath">
+			<title>Getting PsychoPath</title>
+			<para>Standalone jars are only available through nightly builds.  However, you can download the current WTP builds, and use the org.eclipse.wst.xml.xpath2.processor.jar file.   This jar has no dependencies on eclipse, and will work as a standard jar file.  If you are using an OSGI container, then this is treated as a standard OSGI bundle.</para>
+			<para>Additional dependencies you currently need are:</para>
+			<itemizedlist>
+				<listitem>
+					<para>IBM ICU 3.8</para>
+				</listitem>
+				<listitem>
+					<para>Xerces 2.8.0 or greater</para>
+				</listitem>
+				<listitem>
+					<para>JavaCup 0.10 or greater.</para>
+				</listitem>
+			</itemizedlist>
+			<para>These are all available from the 
+				<ulink url="http://download.eclipse.org/tools/orbit/downloads/">Orbit project.</ulink>
+			</para>
+		</section>
+	</chapter>
+	<chapter id="How_to_feed_Psychopath_XPath_expressions">
+		<title>How to feed Psychopath XPath expressions</title>
+		<para>Since PsychoPath has been implemented as an external library and not as a complete program, in order to use it, it needs to be accessed from inside another program. To process XPath 2.0 expressions using PsychoPath from another programs one needs to go through the following process: </para>
+		<orderedlist>
+			<listitem>
+				<para>Load the XML document </para>
+			</listitem>
+			<listitem>
+				<para>Optionally validate the XML document </para>
+			</listitem>
+			<listitem>
+				<para>Initialize static and dynamic context in respect to the document root </para>
+			</listitem>
+			<listitem>
+				<para>Parse the XPath 2.0 expression </para>
+			</listitem>
+			<listitem>
+				<para>Statically verify the XPath 2.0 expression </para>
+			</listitem>
+			<listitem>
+				<para>Evaluate the XPath 2.0 expression in respect to the XML document</para>
+			</listitem>
+		</orderedlist>
+		<para>To give a better idea of how this process actually works, we’ll go through an example of processing and evaluating the string expression “Hello World!”. In this example the XML document that we load is called “XPexample.xml”. </para>
+		<para>All 5 main steps have been explained in detail in 
+			<ulink url="/wiki/PsychoPathXPathProcessor/UserInterface">User Interface</ulink>, so below is just a brief code summary:
+			 
+		</para>
+		<section id="Non-Schema_Aware">
+			<title>Non-Schema Aware</title>
+			
+			<literallayout>/**
+* First load and optionally validate the XML document 
 */
-// Create an InputStream from the XML document
-InputStream is = new FileInputStream(“XPexample.xml”);
-
-// Initializing the Xerces DOM loader.
+</literallayout>
+			<literallayout>// Create an InputStream from the XML document
+InputStream is = new FileInputStream("XPexample.xml");
+</literallayout>
+			<literallayout>// Initializing the Xerces DOM loader.
 DOMLoader loader = new XercesLoader();
-
-// Optionally set flag to validate XML document loader.setvalidating(validate);
+</literallayout>
+			<literallayout>// Optionally set flag to validate XML document
+// loader.set_validating(validate);
 // Loads the XML document and stores the DOM root
 Document doc = loader.load(is);
-
-/**
- * Dynamic contexts must be initialised to defaults
- * dependent on the XML Schema.
-*/
-
-// Extracting the schema from DOM root of Xpexpression.xml.
-ElementPSVI rootPSVI = (ElementPSVI)doc.getDocumentElement();
-XSModel schema = rootPSVI.getSchemaInformation();
-
-// Initialising the DynamicContext.
-DynamicContext dc = new DefaultDynamicContext(schema, doc);
-
-// Register the namespaces of the XPath 2.0 predefined datatypes
-dc.addnamespace(“xs”,”[http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema]”);
-
-// Register the XPath 2.0 standard functions
-dc.addfunctionlibrary(new FnFunctionLibrary());
-dc.addfunctionlibrary(new XSCtrLibrary());
-
-/**
- * Parsing the XPath 2.0 expression into an AST representation
+</literallayout>
+			<literallayout>// Initialising the StaticContext using a builder with suitable defaults.
+StaticContextBuilder scb = new StaticContextBuilder();
+</literallayout>
+			<literallayout>/**
+ * Parsing the XPath 2.0 expression into an executable expression, including
+ * a static check and verification.
  */
-// Initialises PsychoPath’s supplied parser.
-XPathParser xpp = new JflexCupParser();
-
-// Parses the XPath expression.
-XPath xp = xpp.parse(xpath);
-/**
- * Static check the AST to verift structural validity of  
- * XPath 2.0 expression
- */
-
-// Initializing StaticChecker.
-StaticChecker namecheck = new StaticNameResolver(sc);
-
-// Static Checking the Xpath expression ’Hello World!’ namecheck.check(xp);
-/**
- * Evaluate the XPath 2.0 expression
- */
- 
-// Initializing the evaluator with DynamicContext and the name
-// of the XML document XPexample.xml as parameters.
-Evaluator eval = new DefaultEvaluator(dc, doc);
- 
-// Evaluates the XPath 2.0 expression, storing the result
+String xpathText = "string-join(//character/name, ', ')";
+XPath2Expression expr = new Engine().parseExpression(xpathText, scb);
+</literallayout>
+			<literallayout>// Evaluates the XPath 2.0 expression, storing the result
 // in the ResultSequence
-ResultSequence rs = eval.evaluate(xp); 
-</programlisting>
-    </section>
+ResultSequence rs = expr.evaluate(new DynamicContextBuilder(scb),
+	new Object[] { doc });
+</literallayout>
+			<literallayout>for (int i = 0; i &lt; rs.size(); ++i) {
+	System.out.println("#" + i + ": " + rs.value(i));
+}
+</literallayout>
+			<para>
 
-    <section id="Schema_Aware">
-      <title>Schema Aware</title>
-
-      <para></para>
-
-      <programlisting>/**
+</para>
+		</section>
+		<section id="Schema_Aware">
+			<title>Schema Aware</title>
+			
+			<literallayout>/**
  * First load and optionally validate the XML document 
-*/
-
- SchemaFactory schemaFactory = new XMLSchemaFactory();
- URL schemaURL = new File("XPexample.xsd").toURL();
- Schema jaxpschema = schemaFactory.newSchema(schemaURL);
-
+ */
 // Create an InputStream from the XML document
-InputStream is = new FileInputStream(“XPexample.xml”);
-
-// Initializing the Xerces DOM loader.
+InputStream is = new FileInputStream("XPexample.xml");
+</literallayout>
+			<literallayout>SchemaFactory schemaFactory = new XMLSchemaFactory();
+URL schemaURL = new File("XPexample.xsd").toURL();
+Schema jaxpschema = schemaFactory.newSchema(schemaURL);
+</literallayout>
+			<literallayout>// Initializing the Xerces DOM loader.
 DOMLoader loader = new XercesLoader(jaxpschema);
-
-// Optionally set flag to validate XML document loader.setvalidating(validate);
+loader.set_validating(true);
+</literallayout>
+			<literallayout>// Optionally set flag to validate XML document
+// loader.set_validating(validate);
 // Loads the XML document and stores the DOM root
 Document doc = loader.load(is);
-
-/**
- * Dynamic contexts must be initialised to defaults
- * dependent on the XML Schema.
-*/
-
-// Initialising the DynamicContext.
-DynamicContext dc = new DefaultDynamicContext(jaxpschema, doc);
-
-// Register the namespaces of the XPath 2.0 predefined datatypes
-dc.addnamespace(“xs”,”[http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema]”);
-
-// Register the XPath 2.0 standard functions
-dc.addfunctionlibrary(new FnFunctionLibrary());
-dc.addfunctionlibrary(new XSCtrLibrary());
-
-/**
- * Parsing the XPath 2.0 expression into an AST representation
+</literallayout>
+			<literallayout>// Initialising the StaticContext using a builder with suitable defaults.
+StaticContextBuilder scb = new StaticContextBuilder();
+scb.withNamespace("xs", "http://www.w3.org/2001/XMLSchema");
+scb.withTypeModel(new XercesTypeModel(doc));
+</literallayout>
+			<literallayout>/**
+ * Parsing the XPath 2.0 expression into an executable expression, including
+ * a static check and verification.
  */
-// Initialises PsychoPath’s supplied parser.
-XPathParser xpp = new JflexCupParser();
-
-// Parses the XPath expression.
-XPath xp = xpp.parse(xpath);
-
-/**
- * Static check the AST to verift structural validity of  
- * XPath 2.0 expression
- */
-
-// Initilising StaticChecker.
-StaticChecker namecheck = new StaticNameResolver(sc);
-
-// Static Checking the Xpath expression ’Hello World!’ namecheck.check(xp);
-/**
- * Evaluate the XPath 2.0 expression
- */
-
-// Initialising the evaluator with DynamicContext and the name
-// of the XML document XPexample.xml as parameters.
-Evaluator eval = new DefaultEvaluator(dc, doc); 
-
-// Evaluates the XPath 2.0 expression, storing the result
+String xpathText = "for $elem in //*[. instance of xs:normalizedString] return concat(local-name($elem), ' : ', $elem/text())";
+XPath2Expression expr = new Engine().parseExpression(xpathText, scb);
+</literallayout>
+			<literallayout>// Evaluates the XPath 2.0 expression, storing the result
 // in the ResultSequence
-ResultSequence rs = eval.evaluate(xp); 
-</programlisting>
-
-      <para>XPath 2.0 defines everything to be a sequence of items, including
-      the arguments to expressions and the result of operations. Thus, the
-      overall result of an XPath expression evaluation is also a sequence of
-      items. PsychoPath uses the class ResultSequence as a Collections wrapper
-      to store these sequences and therefore, the result of an evaluation is
-      of this type also. The ResultSequence consists of zero or more items; an
-      item may be a node or a simple-value. “Hello World!” is an example of a
-      single value with length 1. A general sequence could be written as (“a”,
-      “s”, “d”, “f”).</para>
-
-      <para>Extraction of certain items from the ResultSequence class is
-      described below, with details of the different operations that one might
-      apply on the ResultSequence. Consider that ’rs’ is the ResultSequence,
-      then:</para>
-
-      <para></para>
-
-      <programlisting>// Will return the number of elements in the sequence, in this
-// case of ’Hello World!’ expression size = 1.
-rs.size(); 
-
-// Will return the n’th element in the sequence, in this case of
-// ’Hello World!’, if n = 1, then it will return
-// XSString of “Hello World!”, but if n = 2, it will return
-// Empty Result.
-rs.get(n);
-
-//Will return true if the sequence is empty.
+ResultSequence rs = expr.evaluate(new DynamicContextBuilder(scb),
+	new Object[] { doc });
+</literallayout>
+			<literallayout>for (int i = 0; i &lt; rs.size(); ++i) {
+	System.out.println("#" + i + ": " + rs.value(i));
+}
+</literallayout>
+			
+			<para>XPath 2.0 defines everything to be a sequence of items, including the arguments to expressions and the result of operations. Thus, the overall result of an XPath expression evaluation is also a sequence of items. PsychoPath uses the class ResultSequence as a Collections wrapper to store these sequences and therefore, the result of an evaluation is of this type also. The ResultSequence consists of zero or more items; an item may be a node or a simple-value. “Hello World!” is an example of a single value with length 1. A general sequence could be written as (“a”, “s”, “d”, “f”). </para>
+			<para>Extraction of certain items from the ResultSequence class is described below, with details of the different operations that one might apply on the ResultSequence. Consider that ’rs’ is the ResultSequence, then: </para>
+			<para>// Will return the number of elements in the sequence, in this </para>
+			<literallayout>// case of ’Hello World!’ expression size = 1. 
+</literallayout>
+			<literallayout>rs.size();
+</literallayout>
+			<literallayout>// Will return the n’th element in the sequence, in this case of 
+// ’Hello World!’, if n = 0, then it will return
+// “Hello World!”.
+</literallayout>
+			<literallayout>rs.value(n);
+</literallayout>
+			<literallayout>//Will return true if the sequence is empty.
 rs.empty(); 
+</literallayout>
+			<literallayout>// Will return the first element of the sequence, 
+// in this example it will return xs:string of “Hello World!” 
+rs.firstValue() 
+</literallayout>
+			<para> 
 
-// Will return the first element of the sequence, 
-// in this example it will return XSString of “Hello World!” 
-rs.first() 
-</programlisting>
-
-      <para>However, all the items extracted will be of the type’s base class
-      AnyType and need to be casted into its actual subtype.</para>
-
-      <para>Certain operations always return a particular type and using this
-      knowledge, the extracted item can be immediately casted. In our example
-      “Hello World!” returns a string (easily known as it is inside the quotes
-      ’ ’ ), so this can safely be casted as such:</para>
-
-      <para><programlisting>XSString xsstring = XSString)(rs.first());</programlisting>The
-      actual result can now be extracted from this XSString in the following
-      manner: <programlisting>String str = xsstring.value();</programlisting></para>
-
-      <para>The details of how to cast extracted items from AnyType into their
-      actual subtypes with examples is in the next section on How to use each
-      production in the grammar.</para>
-
-      <para>However, if the expected return type is unknown or multiple types
-      are possible, the types hierarchy can be traversed in a breadth first
-      manner making use of the Java instanceof operator to ascertain the
-      actual type. </para>
-    </section>
-
-    <section id="How_to_use_the_XPath_2.0_grammar_with_PsychoPath">
-      <title>How to use the XPath 2.0 grammar with PsychoPath</title>
-
-      <para>In this section we will try to give you an overview of the XPath
-      2.0 grammar in general and how each production in the grammar should be
-      used with PsychoPath. For the formal specifications, see the W3C
-      web-site for XPath 2.0 specification <ulink
-      url="http://www.w3.org/TR/xpath20">http://www.w3.org/TR/xpath20</ulink>.</para>
-
-      <section id="Constants">
-        <title>Constants</title>
-
-        <para>String literals are written as “Hello” or ‘Hello’. In each case
-        the opposite kind of quotation mark can be used within the string: ‘He
-        said “Hello” ’ or “London is a big city”. To feed PsychoPath, “ ‘Hello
-        World!’ ”or “ “Hello World!” ” can be used to feed it with strings.
-        Remember that the ResultSequence returns AnyType so since a string is
-        being expected as the result, first it has to be casted in the code
-        like this: <programlisting>XSString xsstring = (XSString)(rs.first());</programlisting>
-        Numeric constants follow the Java rules for decimal literals: for
-        example, 4 or 4.67; a negative number can be written as -3.05. The
-        numeric literal is taken as a double precision floating point number
-        if it uses scientific notation (e.g. 1.0e7), as a fixed point decimal
-        if it includes a decimal point, or as an integer otherwise. When
-        extracting number literals from the ResultSequence, possible types to
-        be returned include <emphasis role="italic">XSDecima''l (e.g. :
-        xs:decimal: 4.67),''XSInteger ''(e.g. : xs:integer: 4) or
-        ''XSDouble</emphasis> (e.g. : xs:double 1e0). All of which need to be
-        cast in the same manner as stated before: from AnyType to their
-        corresponding types.</para>
-
-        <para>There are no boolean constants as such: <emphasis
-        role="italic">true, false</emphasis> instead the function calls
-        <emphasis role="bold">true()</emphasis> and <emphasis
-        role="bold">false()</emphasis> are used.</para>
-
-        <para>Constants of other data types can be written using constructors.
-        These look like function calls but require a string literal as their
-        argument. For example, <emphasis
-        role="bold">xs:float(“10.7”)</emphasis> produces a single-precision
-        floating point number.</para>
-      </section>
-
-      <section id="Path_expressions">
-        <title>Path expressions</title>
-
-        <para>A path expression is a sequence of steps separated by the
-        <emphasis role="bold">/''' or '''//</emphasis> operator. For example,
-        <emphasis role="bold">../@desc</emphasis> selects the desc attribute
-        of the parent of the context node.</para>
-
-        <para>In XPath 2.0, path expressions have been generalized so that any
-        expression can be used as an operand of <emphasis
-        role="bold">/</emphasis>, (both on the left and the right), as long as
-        its value is a sequence of nodes. For example, it is possible to use a
-        union expression (in parentheses) or a call to the id()
-        function.</para>
-
-        <para>In practice, it only makes sense to use expressions on the right
-        of <emphasis role="bold">"/"</emphasis> if they depend on the context
-        item. It is legal to write $x/$y provided both $x and $y are sequences
-        of nodes, but the result is exactly the same as writing <emphasis
-        role="bold"> <emphasis role="italic">./$y</emphasis>
-        </emphasis>.</para>
-
-        <para>Note that the expressions <emphasis role="bold">./$X</emphasis>
-        or <emphasis role="bold">$X/.</emphasis> can be used to remove
-        duplicates from <emphasis role="bold">$X</emphasis> and sort the
-        results into document order.</para>
-
-        <para>The operator <emphasis role="bold">//</emphasis> is an
-        abbreviation for <emphasis
-        role="bold">/descendant-or-self::node()</emphasis>. An expression of
-        the form <emphasis role="bold">/E</emphasis> is shorthand for
-        <emphasis role="bold">root(.)/E</emphasis>, and the expression
-        <emphasis role="bold">/''' on its own is shorthand for
-        '''root(.)</emphasis>.</para>
-      </section>
-
-      <section id="Axis_steps">
-        <title>Axis steps</title>
-
-        <para>The basic primitive for accessing a source document is the axis
-        step. Axis steps may be combined into path expressions using the path
-        operators "/" and "//", and they may be filtered using filter
-        expressions in the same way as the result of any other
-        expression.</para>
-
-        <para>An axis step has the basic form axis::node-test, and selects
-        nodes on a given axis that satisfy the node-test. The axes available
-        are:</para>
-
-        <orderedlist>
-          <listitem>
-            <para>element: age</para>
-          </listitem>
-
-          <listitem>
-            <para>element: age</para>
-          </listitem>
-        </orderedlist>
-
-        <para>The rest of the axes act in the same manner.</para>
-      </section>
-
-      <section id="Set_difference.2C_intersection_and_Union">
-        <title>Set difference, intersection and Union</title>
-
-        <para>The expression E1 except E2 selects all nodes that are in E1
-        unless they are also in E2. Both expressions must return sequences of
-        nodes. The results are returned in document order. For example, @*
-        except @note returns all attributes except the note attribute. The
-        expression E1 intersect E2 selects all nodes that are in both E1 and
-        E2. Both expressions must return sequences of nodes. The results are
-        returned in document order. The expression E1 union E2 selects all
-        nodes that are in either E1 or E2 or both. Both expressions must
-        return sequences of nodes. The results are returned in document order.
-        A complete example of the above expression would be as follows.
-        Consider an XML document which looks like this:</para>
-
-        <programlisting>&lt;nodes&gt;
+				 However, all the items extracted will be of the type’s "native" value (statically known as Object) and need to be casted into its actual subtype. </para>
+			<para>Certain operations always return a particular type and using this knowledge, the extracted item can be immediately casted. In our example “Hello World!” returns a string (easily known as it is inside the quotes ’ ’ ), so this can safely be casted as such: 
+				</para>
+			<literallayout>String string = (String)(rs.value(0));
+ 
+</literallayout>
+			<para>The details of how to cast extracted items from Object into their actual subtypes with examples is in the next section on How to use each production in the grammar. As an alternative, you can call
+				</para>
+			<literallayout>ItemType itype = rs.itemType(n);
+Which will return the type of the n'th item in the result sequence.
+</literallayout>
+			<para>
+</para>
+		</section>
+		<section id="How_to_use_the_XPath_2.0_grammar_with_PsychoPath">
+			<title>How to use the XPath 2.0 grammar with PsychoPath</title>
+			<para>In this section we will try to give you an overview of the XPath 2.0 grammar in general and how each production in the grammar should be used with PsychoPath. For the formal specifications, see the W3C web-site for XPath 2.0 specification 
+				<ulink url="http://www.w3.org/TR/xpath20">http://www.w3.org/TR/xpath20</ulink>.
+				 
+			</para>
+			<section id="Constants">
+				<title>Constants</title>
+				<para>String literals are written as “Hello” or ‘Hello’. In each case the opposite kind of quotation mark can be used within the string: ‘He said “Hello” ’ or “London is a big city”. To feed PsychoPath, “ ‘Hello World!’ ”or “ “Hello World!” ” can be used to feed it with strings. Remember that the ResultSequence returns AnyType so since a string is being expected as the result, first it has to be casted in the code like this: 
+					String xsstring = (String)(rs.firstValue()); 
+					Numeric constants follow the Java rules for decimal literals: for example, 4 or 4.67; a negative number can be written as -3.05. The numeric literal is taken as a double precision floating point number if it uses scientific notation (e.g. 1.0e7), as a fixed point decimal if it includes a decimal point, or as an integer otherwise. When extracting number literals from the ResultSequence, possible types to be returned include 
+					<emphasis role="italic">BigDecima''l (e.g.&nbsp;: xs:decimal: 4.67),''Int ''(e.g.&nbsp;: xs:integer: 4) or ''XSDouble</emphasis> (e.g.&nbsp;: xs:double 1e0). All of which need to be casted in the same manner as stated before: from AnyType to their corresponding types. 
+				</para>
+				<para>There are no boolean constants as such: 
+					<emphasis role="italic">true, false</emphasis> instead the function calls 
+					<emphasis role="bold">true()</emphasis> and 
+					<emphasis role="bold">false()</emphasis> are used. 
+				</para>
+				<para>Constants of other data types can be written using constructors. These look like function calls but require a string literal as their argument. For example, 
+					<emphasis role="bold">xs:float(“10.7”)</emphasis> produces a single-precision floating point number.
+					 
+				</para>
+			</section>
+			<section id="Path_expressions">
+				<title>Path expressions</title>
+				<para>A path expression is a sequence of steps separated by the 
+					<emphasis role="bold">/''' or '''//</emphasis> operator. For example, 
+					<emphasis role="bold">../@desc</emphasis> selects the desc attribute of the parent of the context node. 
+				</para>
+				<para>In XPath 2.0, path expressions have been generalized so that any expression can be used as an operand of 
+					<emphasis role="bold">/</emphasis>, (both on the left and the right), as long as its value is a sequence of nodes. For example, it is possible to use a union expression (in parentheses) or a call to the id() function. 
+				</para>
+				<para>In practice, it only makes sense to use expressions on the right of 
+					<emphasis role="bold">"/"</emphasis> if they depend on the context item. It is legal to write $x/$y provided both $x and $y are sequences of nodes, but the result is exactly the same as writing 
+					<emphasis role="bold">
+						<emphasis role="italic">./$y</emphasis>
+					</emphasis>. 
+				</para>
+				<para>Note that the expressions 
+					<emphasis role="bold">./$X</emphasis> or 
+					<emphasis role="bold">$X/.</emphasis> can be used to remove duplicates from 
+					<emphasis role="bold">$X</emphasis> and sort the results into document order. 
+					 
+				</para>
+				<para>The operator 
+					<emphasis role="bold">//</emphasis> is an abbreviation for 
+					<emphasis role="bold">/descendant-or-self::node()</emphasis>. An expression of the form 
+					<emphasis role="bold">/E</emphasis> is shorthand for 
+					<emphasis role="bold">root(.)/E</emphasis>, and the expression 
+					<emphasis role="bold">/''' on its own is shorthand for '''root(.)</emphasis>. 
+				</para>
+			</section>
+			<section id="Axis_steps">
+				<title>Axis steps</title>
+				<para>The basic primitive for accessing a source document is the axis step. Axis steps may be combined into path expressions using the path operators "/" and "//", and they may be filtered using filter expressions in the same way as the result of any other expression. </para>
+				<para>An axis step has the basic form axis::node-test, and selects nodes on a given axis that satisfy the node-test. The axes available are: </para>
+				<orderedlist>
+					<listitem>
+						<para>element: age </para>
+					</listitem>
+					<listitem>
+						<para>element: age</para>
+					</listitem>
+				</orderedlist>
+				<para>The rest of the axes act in the same manner.
+					 </para>
+			</section>
+			<section id="Set_difference.2C_intersection_and_Union">
+				<title>Set difference, intersection and Union</title>
+				<para>The expression E1 except E2 selects all nodes that are in E1 unless they are also in E2. Both expressions must return sequences of nodes. The results are returned in document order. For example, @* except @note returns all attributes except the note attribute. The expression E1 intersect E2 selects all nodes that are in both E1 and E2. Both expressions must return sequences of nodes. The results are returned in document order. The expression E1 union E2 selects all nodes that are in either E1 or E2 or both. Both expressions must return sequences of nodes. The results are returned in document order. A complete example of the above expression would be as follows. Consider an XML document which looks like this: </para>
+				<literallayout>&lt;source lang="xml"&gt;
+&lt;nodes&gt;
   &lt;a&gt;
     &lt;connecteda&gt;A&lt;/connecteda&gt;
     &lt;connecteda&gt;B&lt;/connecteda&gt;
@@ -429,269 +259,257 @@
     &lt;connectedb&gt;D&lt;/connectedb&gt;
   &lt;/b&gt;
 &lt;/nodes&gt;
-</programlisting>
+</literallayout>
+				<para> 
+					then an example of each of the expressions would be: </para>
+				<literallayout>data(/a/*) union data(/b/*)
+</literallayout>
+				<para> 
 
-        <para>Then an example of each of the expressions would be:</para>
+					<emphasis role="italic">'result: '</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:string: A </para>
+					</listitem>
+					<listitem>
+						<para>xs:string: B </para>
+					</listitem>
+					<listitem>
+						<para>xs:string: C </para>
+					</listitem>
+					<listitem>
+						<para>xs:string: D
+</para>
+					</listitem>
+				</orderedlist>
+				<literallayout>data(/a/*) intersect data(/b/*)
+</literallayout>
+				<para> 
 
-        <para><programlisting>data(/a/*) union data(/b/*)</programlisting></para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:string: B </para>
+					</listitem>
+					<listitem>
+						<para>xs:string: C
+</para>
+					</listitem>
+				</orderedlist>
+				<literallayout>data(/a/*) except data(/b/*)
+</literallayout>
+				<para> 
 
-        <para> <emphasis role="bold">result:</emphasis></para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:string: D
+</para>
+					</listitem>
+				</orderedlist>
+			</section>
+			<section id="Arithmetic_Expressions">
+				<title>Arithmetic Expressions</title>
+				<section id="Unary">
+					<title>Unary</title>
+					<para>minus and plus: The unary minus operator changes the sign of a number. For example -1 is minus one, and -1e0 is the double value negative -1. </para>
+				</section>
+				<section id="Multiplication_and_Division:">
+					<title>Multiplication and Division:</title>
+					<para>The operator * multiplies two numbers. If the operands are of different types, XPath 2.0 specifications say that one of them is promoted to the type of the other.&nbsp;<strike></strike> The result is the same type as the operands after promotion. </para>
+					<para>
+						 The operator div divides two numbers. Dividing two integers produces a double; in other cases the result is the same type as the operands. </para>
+					<para>
+						 The operator idiv performs integer division. For example, the result of 10 idiv 3 is 3. </para>
+					<para>
+						 The mod operator returns the modulus (or remainder) after division. </para>
+					<para>
+						 The operators * and div may also be used to multiply or divide a range by a number. </para>
+					<para>For example, 
+						<emphasis role="italic">(1 idiv 1 to 3)</emphasis> returns the result: 
+						<emphasis role="italic">xs:integer: 1, xs:integer: 2, xs:integer: 3</emphasis> 
+					</para>
+				</section>
+				<section id="Addition_and_Subtraction:">
+					<title>Addition and Subtraction:</title>
+					<para>The operators 
+						<emphasis role="bold">+</emphasis> and 
+						<emphasis role="italic">'-'</emphasis> perform addition and subtraction of numbers, in the usual way. Once again, if the operands are of different types, XPath 2.0 specifications say one of them is promoted but numeric type promotion is currently unsupported by PsychoPath. The result is of the same type as the operands. 
+					</para>
+					<para>Examples of above would be: </para>
+					<literallayout>-(5 + 7)
+</literallayout>
+					<para> 
 
-        <orderedlist>
-          <listitem>
-            <para>xs:string: A</para>
-          </listitem>
+						<emphasis role="bold">result:</emphasis>
+						 
+					</para>
+					<orderedlist>
+						<listitem>
+							<para>xs:integer: -12</para>
+						</listitem>
+					</orderedlist>
+					<literallayout>-xs:float(’1.23’)
+</literallayout>
+					<para> 
 
-          <listitem>
-            <para>xs:string: B</para>
-          </listitem>
+						<emphasis role="bold">result:</emphasis>
 
-          <listitem>
-            <para>xs:string: C</para>
-          </listitem>
+					</para>
+					<orderedlist>
+						<listitem>
+							<para>xs:float: -1.23 
+</para>
+						</listitem>
+					</orderedlist>
+					<literallayout>-xs:double(’1.23’)
+</literallayout>
+					<para> 
 
-          <listitem>
-            <para>xs:string: D</para>
-          </listitem>
-        </orderedlist>
+						<emphasis role="bold">result:</emphasis>
 
-        <para><programlisting>data(/a/*) intersect data(/b/*)</programlisting></para>
+					</para>
+					<orderedlist>
+						<listitem>
+							<para>xs:double: -1.23 
+</para>
+						</listitem>
+					</orderedlist>
+					<literallayout>(+5 - +7)
+</literallayout>
+					<para> 
 
-        <para> <emphasis role="bold">result:</emphasis></para>
+						<emphasis role="bold">result:</emphasis>
 
-        <orderedlist>
-          <listitem>
-            <para>xs:string: B</para>
-          </listitem>
+					</para>
+					<orderedlist>
+						<listitem>
+							<para>xs:integer: -2 
+</para>
+						</listitem>
+					</orderedlist>
+					<literallayout>(1 to 5 div 0 )
+</literallayout>
+					<para> 
 
-          <listitem>
-            <para>xs:string: C</para>
-          </listitem>
-        </orderedlist>
+						<emphasis role="bold">result:</emphasis> 
 
-        <para><programlisting>data(/a/*) except data(/b/*)</programlisting></para>
+					</para>
+					<itemizedlist>
+						<listitem>
+							<para>FAIL (division by zero!) 
+</para>
+						</listitem>
+					</itemizedlist>
+					<literallayout>5*6*10*5*96 div 20 div 3 div 1
+</literallayout>
+					<para> 
 
-        <para> <emphasis role="bold">result:</emphasis></para>
+						<emphasis role="bold">result:</emphasis>
 
-        <orderedlist>
-          <listitem>
-            <para>xs:string: D</para>
-          </listitem>
-        </orderedlist>
-      </section>
+					</para>
+					<orderedlist>
+						<listitem>
+							<para>xs:decimal: 2400.0 
+</para>
+						</listitem>
+					</orderedlist>
+					<literallayout>31 mod 15
+</literallayout>
+					<para> 
 
-      <section id="Arithmetic_Expressions">
-        <title>Arithmetic Expressions</title>
+						<emphasis role="bold">result:</emphasis> 
 
-        <section id="Unary">
-          <title>Unary</title>
+					</para>
+					<orderedlist>
+						<listitem>
+							<para>xs:integer: 1
+</para>
+						</listitem>
+					</orderedlist>
+				</section>
+			</section>
+			<section id="Range_expressions">
+				<title>Range expressions</title>
+				<para>The expression E1 to E2 returns a sequence of integers. For example, 1 to 5 returns the sequence 1, 2, 3, 4, 5. This is useful in for expressions, for example the first five nodes of a node sequence can be processed by writing for $i in 1 to 5 return (//x)
+					<ulink url="$i">$i</ulink>. Another example: 
+				</para>
+				<literallayout>(1+1 to 10)
+</literallayout>
+				<para> 
 
-          <para>minus and plus: The unary minus operator changes the sign of a
-          number. For example -1 is minus one, and -1e0 is the double value
-          negative -1.</para>
-        </section>
-
-        <section id="Multiplication_and_Division:">
-          <title>Multiplication and Division:</title>
-
-          <para>The operator * multiplies two numbers. If the operands are of
-          different types, XPath 2.0 specifications say that one of them is
-          promoted to the type of the other. The result is the same type as
-          the operands after promotion.</para>
-
-          <para>The operator div divides two numbers. Dividing two integers
-          produces a double; in other cases the result is the same type as the
-          operands.</para>
-
-          <para>The operator idiv performs integer division. For example, the
-          result of 10 idiv 3 is 3.</para>
-
-          <para>The mod operator returns the modulus (or remainder) after
-          division.</para>
-
-          <para>The operators * and div may also be used to multiply or divide
-          a range by a number.</para>
-
-          <para>For example, <emphasis role="italic">(1 idiv 1 to
-          3)</emphasis> returns the result: <emphasis
-          role="italic">xs:integer: 1, xs:integer: 2, xs:integer:
-          3</emphasis></para>
-        </section>
-
-        <section id="Addition_and_Subtraction:">
-          <title>Addition and Subtraction:</title>
-
-          <para>The operators <emphasis role="bold">+</emphasis> and <emphasis
-          role="italic">'-'</emphasis> perform addition and subtraction of
-          numbers, in the usual way. Once again, if the operands are of
-          different types, XPath 2.0 specifications say one of them is
-          promoted but numeric type promotion is currently unsupported by
-          PsychoPath. The result is of the same type as the operands.</para>
-
-          <para>Examples of above would be:</para>
-
-          <para><programlisting> -(5 + 7)</programlisting></para>
-
-          <para> <emphasis role="bold">result:</emphasis></para>
-
-          <orderedlist>
-            <listitem>
-              <para>xs:integer: -12</para>
-            </listitem>
-          </orderedlist>
-
-          <para><programlisting>-xs:float(’1.23’)</programlisting></para>
-
-          <para> <emphasis role="bold">result:</emphasis></para>
-
-          <orderedlist>
-            <listitem>
-              <para>xs:float: -1.23</para>
-            </listitem>
-          </orderedlist>
-
-          <para><programlisting>-xs:double(’1.23’)</programlisting></para>
-
-          <para> <emphasis role="bold">result:</emphasis></para>
-
-          <orderedlist>
-            <listitem>
-              <para>xs:double: -1.23</para>
-            </listitem>
-          </orderedlist>
-
-          <para><programlisting>(+5 - +7)</programlisting></para>
-
-          <para> <emphasis role="bold">result:</emphasis></para>
-
-          <orderedlist>
-            <listitem>
-              <para>xs:integer: -2</para>
-            </listitem>
-          </orderedlist>
-
-          <para><programlisting>(1 to 5 div 0 )</programlisting></para>
-
-          <para> <emphasis role="bold">result:</emphasis></para>
-
-          <itemizedlist>
-            <listitem>
-              <para>FAIL (division by zero!)</para>
-            </listitem>
-          </itemizedlist>
-
-          <para><programlisting>5*6*10*5*96 div 20 div 3 div 1</programlisting></para>
-
-          <para> <emphasis role="bold">result:</emphasis></para>
-
-          <orderedlist>
-            <listitem>
-              <para>xs:decimal: 2400.0</para>
-            </listitem>
-          </orderedlist>
-
-          <para><programlisting>31 mod 15</programlisting></para>
-
-          <para> <emphasis role="bold">result:</emphasis></para>
-
-          <orderedlist>
-            <listitem>
-              <para>xs:integer: 1</para>
-            </listitem>
-          </orderedlist>
-        </section>
-      </section>
-
-      <section id="Range_expressions">
-        <title>Range expressions</title>
-
-        <para>The expression E1 to E2 returns a sequence of integers. For
-        example, 1 to 5 returns the sequence 1, 2, 3, 4, 5. This is useful in
-        for expressions, for example the first five nodes of a node sequence
-        can be processed by writing for $i in 1 to 5 return (//x) <ulink
-        url="$i">$i</ulink>. Another example:</para>
-
-        <para><programlisting>(1+1 to 10)</programlisting></para>
-
-        <para> <emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>xs:integer: 2</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 3</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 4</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 5</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 6</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 7</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 8</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 9</para>
-          </listitem>
-
-          <listitem>
-            <para>xs:integer: 10</para>
-          </listitem>
-        </orderedlist>
-      </section>
-
-      <section id="Comparisons">
-        <title>Comparisons</title>
-
-        <para>The simplest comparison operators are <emphasis
-        role="bold">eq</emphasis>, <emphasis role="bold">ne</emphasis>,
-        <emphasis role="bold">lt</emphasis>, <emphasis
-        role="bold">le</emphasis>, <emphasis role="bold">gt</emphasis>,
-        <emphasis role="bold">ge</emphasis>. These compare two atomic values
-        of the same type, for example two integers, two dates, or two strings.
-        (Collation hasn’t been implemented in current version of PsychoPath).
-        If the operands are not atomic values, an error is raised.</para>
-
-        <para>The operators <emphasis role="bold">=''', </emphasis>!='
-        <emphasis role="italic">, '</emphasis>&lt;=' <emphasis role="italic">,
-        '</emphasis>&gt; <emphasis role="bold">, '''&lt;</emphasis>, and
-        <emphasis role="bold">&gt;=</emphasis> can compare arbitrary
-        sequences. The result is true if any pair of items from the two
-        sequences has the specified relationship, for example <emphasis
-        role="italic">$A = $B</emphasis> is true if there is an item in
-        <emphasis role="italic">$A</emphasis> that is equal to some item in
-        <emphasis role="italic">$B</emphasis>.</para>
-
-        <para>The operators <emphasis role="bold">is</emphasis> and <emphasis
-        role="bold">isnot</emphasis> test whether the operands represent the
-        same (identical) node. For example, <emphasis role="italic">title
-        <ulink url="1">1</ulink> is * <ulink url="@note">@note</ulink> <ulink
-        url="1">1</ulink> </emphasis> is true if the first title child is the
-        first child element that has a <emphasis
-        role="italic">@note</emphasis> attribute. If either operand is an
-        empty sequence the result is an empty sequence (which will usually be
-        treated as false).</para>
-
-        <para>The operators <emphasis role="bold">&lt;&lt;</emphasis> and
-        <emphasis role="bold">&gt;&gt;</emphasis> test whether one node
-        precedes or follows another in document order. Consider this XML
-        document:</para>
-
-        <programlisting>&lt;book&gt;
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:integer: 2 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 3 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 4 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 5 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 6 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 7 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 8 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 9 </para>
+					</listitem>
+					<listitem>
+						<para>xs:integer: 10
+</para>
+					</listitem>
+				</orderedlist>
+			</section>
+			<section id="Comparisons">
+				<title>Comparisons</title>
+				<para>The simplest comparison operators are 
+					<emphasis role="bold">eq</emphasis>, 
+					<emphasis role="bold">ne</emphasis>, 
+					<emphasis role="bold">lt</emphasis>, 
+					<emphasis role="bold">le</emphasis>, 
+					<emphasis role="bold">gt</emphasis>, 
+					<emphasis role="bold">ge</emphasis>. These compare two atomic values of the same type, for example two integers, two dates, or two strings. (Collation hasn’t been implemented in current version of PsychoPath). If the operands are not atomic values, an error is raised. 
+				</para>
+				<para>The operators 
+					<emphasis role="bold">=''',&nbsp;</emphasis>!='
+					<emphasis role="italic">, '</emphasis>&lt;='
+					<emphasis role="italic">, '</emphasis>&gt;
+					<emphasis role="bold">, '''&lt;</emphasis>, and 
+					<emphasis role="bold">&gt;=</emphasis> can compare arbitrary sequences. The result is true if any pair of items from the two sequences has the specified relationship, for example 
+					<emphasis role="italic">$A = $B</emphasis> is true if there is an item in 
+					<emphasis role="italic">$A</emphasis> that is equal to some item in 
+					<emphasis role="italic">$B</emphasis>. 
+				</para>
+				<para>The operators 
+					<emphasis role="bold">is</emphasis> and 
+					<emphasis role="bold">isnot</emphasis> test whether the operands represent the same (identical) node. For example, 
+					<emphasis role="italic">title
+						<ulink url="1">1</ulink> is *
+						<ulink url="@note">@note</ulink>
+						<ulink url="1">1</ulink>
+					</emphasis> is true if the first title child is the first child element that has a 
+					<emphasis role="italic">@note</emphasis> attribute. If either operand is an empty sequence the result is an empty sequence (which will usually be treated as false). 
+				</para>
+				<para>The operators 
+					<emphasis role="bold">&lt;&lt;</emphasis> and 
+					<emphasis role="bold">&gt;&gt;</emphasis> test whether one node precedes or follows another in document order. Consider this XML document (XPexample.xml): 
+					&lt;source lang="xml"&gt;
+				</para>
+				<literallayout>&lt;book&gt;
  &lt;title&gt;Being a Dog Is a Full-Time Job&lt;/title&gt;
  &lt;author&gt;Charles M. Schulz&lt;/author&gt;
  &lt;character&gt;
@@ -708,585 +526,501 @@
    &lt;qualification&gt;bold, brash and tomboyish&lt;/qualification&gt;
  &lt;/character&gt;
 &lt;/book&gt;
-</programlisting>
+</literallayout>
+				<para> </para>
+				<para>This file conforms to the following Schema (XPexample.xsd):</para>
+				<para>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</para>
+				<literallayout>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"&gt;
+</literallayout>
+				<literallayout> &lt;xs:element name="book"&gt;
+   &lt;xs:complexType&gt;
+     &lt;xs:sequence&gt;
+       &lt;xs:element ref="title" /&gt;
+       &lt;xs:element ref="author" /&gt;
+       &lt;xs:element maxOccurs="unbounded" ref="character" /&gt;
+     &lt;/xs:sequence&gt;
+   &lt;/xs:complexType&gt;
+ &lt;/xs:element&gt;
+</literallayout>
+				<literallayout> &lt;xs:element name="title" type="characterName"&gt;&lt;/xs:element&gt;
+</literallayout>
+				<literallayout> &lt;xs:element name="author" type="characterName"&gt;&lt;/xs:element&gt;
+</literallayout>
+				<literallayout> &lt;xs:element name="character"&gt;
+   &lt;xs:complexType&gt;
+     &lt;xs:sequence&gt;
+       &lt;xs:element ref="name" /&gt;
+       &lt;xs:element ref="friend-of" minOccurs="0" /&gt;
+       &lt;xs:element ref="since" /&gt;
+       &lt;xs:element ref="age" /&gt;
+       &lt;xs:element ref="qualification" /&gt;
+     &lt;/xs:sequence&gt;
+   &lt;/xs:complexType&gt;
+ &lt;/xs:element&gt;
+ &lt;xs:element name="name" type="characterName" /&gt;
+ &lt;xs:element name="friend-of" type="characterName" /&gt;
+ &lt;xs:element name="since" type="xs:date" /&gt;
+ &lt;xs:element name="age" type="xs:nonNegativeInteger" /&gt;
+ &lt;xs:element name="qualification" type="xs:string" /&gt;
+</literallayout>
+				<literallayout> &lt;xs:simpleType name="characterName"&gt;
+   &lt;xs:restriction base="xs:normalizedString"&gt;
+     &lt;xs:minLength value="1"/&gt;
+   &lt;/xs:restriction&gt;
+ &lt;/xs:simpleType&gt;
+&lt;/xs:schema&gt;
+</literallayout>
+				<para> </para>
+				<para>
+					<emphasis role="bold">
+						<emphasis role="italic">Examples:</emphasis>
+					</emphasis> 
+				</para>
+				<literallayout>book/character[name="Snoopy"] &amp;lt;&amp;lt; book/character[name="Peppermint Patty"] 
+</literallayout>
+				<para> 
 
-        <para>Example:</para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:boolean: true</para>
+					</listitem>
+				</orderedlist>
+				<literallayout>book/character[name="Peppermint Patty"] &amp;lt;&amp;lt; book/character[name="Snoopy"]
+</literallayout>
+				<para> 
 
-        <para><programlisting>book/character name="Snoopy" &lt;&lt; book/character Patty" </programlisting></para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:boolean: false</para>
+					</listitem>
+				</orderedlist>
+			</section>
+			<section id="Conditional_Expressions">
+				<title>Conditional Expressions</title>
+				<para>XPath 2.0 allows a conditional expression of the form 
+					<emphasis role="italic">if ( E1 ) then E2 else E3</emphasis>. For example, 
+					<emphasis role="italic">if (@discount) then @discount else 0</emphasis> returns the value of the discount attribute if it is present, or zero otherwise. 
+				</para>
+				<para>
+					 </para>
+			</section>
+			<section id="Quantified_Expressions">
+				<title>Quantified Expressions</title>
+				<para>The expression 
+					<emphasis role="italic">some $x in E1 satisfies E2</emphasis> returns true if there is an item in the sequence E1 for which the effective boolean value of E2 is true. Note that E2 must use the range variable 
+					<emphasis role="italic">$x</emphasis> to refer to the item being tested; it does not become the context item. For example, 
+					<emphasis role="italic">some $x in @* satisfies $x eq ""</emphasis> is true if the context item is an element that has at least one zero-length attribute value. 
+				</para>
+				<para>Similarly, the expression 
+					<emphasis role="italic">every $x in E1 satisfies E2</emphasis> returns true if every item in the sequence given by E1 satisfies the condition. 
+				</para>
+			</section>
+			<section id="And.2C_Or_Expressions">
+				<title>And, Or Expressions</title>
+				<para>The expression 
+					<emphasis role="italic">E1 and E2</emphasis> returns true if the effective boolean values of E1 and E2 are both true. The expression 
+					<emphasis role="italic">E1 or E2</emphasis> returns true if the effective boolean values of either or both of E1 and E2 are true. 
+				</para>
+				<para>
+					<emphasis role="bold">
+						<emphasis role="italic">Example:</emphasis>
+					</emphasis> (for a truth table) 
+				</para>
+				<literallayout>1 and 1
+</literallayout>
+				<para> 
 
-        <para><emphasis role="bold">result:</emphasis></para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:boolean: true</para>
+					</listitem>
+				</orderedlist>
+				<para>
+					 </para>
+				<literallayout>1 and 0
+</literallayout>
+				<para> 
 
-        <orderedlist>
-          <listitem>
-            <para>xs:boolean: true</para>
-          </listitem>
-        </orderedlist>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:boolean: false</para>
+					</listitem>
+				</orderedlist>
+				<para>
+					 </para>
+				<literallayout>1 or 0
+</literallayout>
+				<para> 
 
-        <para>book/character <ulink url="name=&quot;Peppermint">Patty"</ulink>
-        &lt;&lt; book/character <ulink
-        url="name=&quot;Snoopy&quot;">name="Snoopy"</ulink> <emphasis
-        role="bold">result:</emphasis></para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:boolean: true</para>
+					</listitem>
+				</orderedlist>
+				<para>
+					 </para>
+				<literallayout>0 or 1
+</literallayout>
+				<para> 
 
-        <orderedlist>
-          <listitem>
-            <para>xs:boolean: false</para>
-          </listitem>
-        </orderedlist>
-      </section>
-
-      <section id="Conditional_Expressions">
-        <title>Conditional Expressions</title>
-
-        <para>XPath 2.0 allows a conditional expression of the form <emphasis
-        role="italic">if ( E1 ) then E2 else E3</emphasis>. For example,
-        <emphasis role="italic">if (@discount) then @discount else
-        0</emphasis> returns the value of the discount attribute if it is
-        present, or zero otherwise.</para>
-      </section>
-
-      <section id="Quantified_Expressions">
-        <title>Quantified Expressions</title>
-
-        <para>The expression <emphasis role="italic">some $x in E1 satisfies
-        E2</emphasis> returns true if there is an item in the sequence E1 for
-        which the effective boolean value of E2 is true. Note that E2 must use
-        the range variable <emphasis role="italic">$x</emphasis> to refer to
-        the item being tested; it does not become the context item. For
-        example, <emphasis role="italic">some $x in @* satisfies $x eq
-        ""</emphasis> is true if the context item is an element that has at
-        least one zero-length attribute value.</para>
-
-        <para>Similarly, the expression <emphasis role="italic">every $x in E1
-        satisfies E2</emphasis> returns true if every item in the sequence
-        given by E1 satisfies the condition.</para>
-      </section>
-
-      <section id="And.2C_Or_Expressions">
-        <title>And, Or Expressions</title>
-
-        <para>The expression <emphasis role="italic">E1 and E2</emphasis>
-        returns true if the effective boolean values of E1 and E2 are both
-        true. The expression <emphasis role="italic">E1 or E2</emphasis>
-        returns true if the effective boolean values of either or both of E1
-        and E2 are true.</para>
-
-        <para><programlisting> (for a truth table) 1 and 1</programlisting></para>
-
-        <para><emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>xs:boolean: true</para>
-          </listitem>
-        </orderedlist>
-
-        <para><programlisting>1 and 0</programlisting></para>
-
-        <para> <emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>xs:boolean: false</para>
-          </listitem>
-        </orderedlist>
-
-        <para><programlisting>1 or 0</programlisting></para>
-
-        <para> <emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>xs:boolean: true</para>
-          </listitem>
-        </orderedlist>
-
-        <para><programlisting>0 or 1</programlisting></para>
-
-        <para> <emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>xs:boolean: true</para>
-          </listitem>
-        </orderedlist>
-
-        <para></para>
-      </section>
-
-      <section id="SequenceType_Matching_Expressions">
-        <title>SequenceType Matching Expressions</title>
-
-        <para>The rules for SequenceType matching compare the actual type of a
-        value with an expected type. These rules are a subset of the formal
-        rules that match a value with an expected type defined in XQuery 1.0
-        and XPath 2.0 Formal Semantics <ulink
-        url="http://www.w3.org/TR/xpath20/#XQueryFormalSemantics">http://www.w3.org/TR/xpath20/#XQueryFormalSemantics</ulink>,
-        because the Formal Semantics must be able to match a value with any
-        XML Schema type, whereas the rules below only match values against
-        those types expressible by the SequenceType syntax.</para>
-
-        <para>Some of the rules for SequenceType matching require determining
-        whether a given type name is the same as or derived from an expected
-        type name. The given type name may be "known" (defined in the in-scope
-        schema definitions), or "unknown" (not defined in the in-scope schema
-        definitions). An unknown type name might be encountered, for example,
-        if a source document has been validated using a schema that was not
-        imported into the static context. In this case, an implementation is
-        allowed (but is not required) to provide an implementation-dependent
-        mechanism for determining whether the unknown type name is derived
-        from the expected type name. For example, an implementation might
-        maintain a data dictionary containing information about type
-        hierarchies. consider the following XML document:</para>
-
-        <programlisting>&lt;sorbo&gt;
- &lt;is&gt;elite&lt;/is&gt;
+					<emphasis role="italic">'result: '</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:boolean: true</para>
+					</listitem>
+				</orderedlist>
+				<para>
+					 </para>
+			</section>
+			<section id="SequenceType_Matching_Expressions">
+				<title>SequenceType Matching Expressions</title>
+				<para>The rules for SequenceType matching compare the actual type of a value with an expected type. These rules are a subset of the formal rules that match a value with an expected type defined in XQuery 1.0 and XPath 2.0 Formal Semantics 
+					<ulink url="http://www.w3.org/TR/xpath20/#XQueryFormalSemantics">http://www.w3.org/TR/xpath20/#XQueryFormalSemantics</ulink>, because the Formal Semantics must be able to match a value with any XML Schema type, whereas the rules below only match values against those types expressible by the SequenceType syntax. 
+				</para>
+				<para>Some of the rules for SequenceType matching require determining whether a given type name is the same as or derived from an expected type name. The given type name may be "known" (defined in the in-scope schema definitions), or "unknown" (not defined in the in-scope schema definitions). An unknown type name might be encountered, for example, if a source document has been validated using a schema that was not imported into the static context. In this case, an implementation is allowed (but is not required) to provide an implementation-dependent mechanism for determining whether the unknown type name is derived from the expected type name. For example, an implementation might maintain a data dictionary containing information about type hierarchies. consider the following XML document: 
+					&lt;source lang="xml"&gt;&lt;sorbo&gt;</para>
+				<literallayout> &lt;is&gt;elite&lt;/is&gt;
  &lt;!-- life sux --&gt;
-&lt;/sorbo&gt;
-</programlisting>
+</literallayout>
+				<para>&lt;/sorbo&gt;
+					 
+					then, the following are some example of SequenceType matchings: </para>
+				<literallayout>element({*})
+</literallayout>
+				<para> 
 
-        <para>Then, the following are some example of SequenceType
-        matchings:</para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>element: sorbo</para>
+					</listitem>
+				</orderedlist>
+				<para>
+					 </para>
+				<literallayout>element(elite)
+</literallayout>
+				<para> 
 
-        <para><programlisting> element({*})</programlisting></para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>Empty results</para>
+					</listitem>
+				</orderedlist>
+				<literallayout> sorbo/comment()
+</literallayout>
+				<para> 
 
-        <para> <emphasis role="bold">result:</emphasis></para>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>comment: life sux</para>
+					</listitem>
+				</orderedlist>
+				<literallayout> data(/sorbo/comment())
+</literallayout>
+				<para> 
 
-        <orderedlist>
-          <listitem>
-            <para>element: sorbo</para>
-          </listitem>
-        </orderedlist>
+					<emphasis role="bold">result:</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>xs:string: life sux</para>
+					</listitem>
+				</orderedlist>
+				<para>
+					 </para>
+				<literallayout>sorbo/node()
+</literallayout>
+				<para> 
 
-        <para><programlisting>element(elite)</programlisting></para>
-
-        <para> <emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>Empty results</para>
-          </listitem>
-        </orderedlist>
-
-        <para><programlisting>sorbo/comment()</programlisting></para>
-
-        <para> <emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>comment: life sux</para>
-          </listitem>
-        </orderedlist>
-
-        <para><programlisting>data(/sorbo/comment())</programlisting></para>
-
-        <para> <emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>xs:string: life sux</para>
-          </listitem>
-        </orderedlist>
-
-        <para><programlisting>sorbo/node()</programlisting></para>
-
-        <para><emphasis role="bold">result:</emphasis></para>
-
-        <orderedlist>
-          <listitem>
-            <para>text:</para>
-          </listitem>
-
-          <listitem>
-            <para>element: is</para>
-          </listitem>
-
-          <listitem>
-            <para>comment: life sux</para>
-          </listitem>
-
-          <listitem>
-            <para>text:</para>
-          </listitem>
-        </orderedlist>
-
-        <para></para>
-      </section>
-    </section>
-  </chapter>
-
-  <chapter id="How_to_use_XPath_2.0_functions_with_PsychoPath">
-    <title>How to use XPath 2.0 functions with PsychoPath</title>
-
-    <para>The aim of this section is to give the user an overview of the
-    available XPath 2.0 functions that are implemented in PsychoPath. For the
-    formal specifications, see the W3C web-site for XPath 2.0 functions and
-    operators <ulink
-    url="http://www.w3.org/TR/xpath-functions/">http://www.w3.org/TR/xpath-functions/</ulink>.</para>
-
-    <section id="Accessors">
-      <title>Accessors</title>
-
-      <para>In order for PsychoPath to operate on instances of the XPath 2.0
-      data model, the model must expose the properties of the items it
-      contains. It does this by defining a family of accessor functions. These
-      functions are not available to users or applications to call directly.
-      Instead, they are descriptions of the information that an implementation
-      of the model must expose to applications.</para>
-
-      <para>data(‘string’)</para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XSString)rs.first()).stringvalue();
-println(n);</programlisting></para>
-
-      <para>In order to get the result of ‘string’</para>
-    </section>
-
-    <section id="Constructor_Functions">
-      <title>Constructor Functions</title>
-
-      <para><programlisting>xs:dateTime("2002-02-01T10:00:00+06:00")</programlisting></para>
-
-      <para>From within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XSDateTime)rs.first()).stringvalue(); println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘2002-02-01T04:00:00Z’</para>
-    </section>
-
-    <section id="Functions_on_Numeric_Values">
-      <title>Functions on Numeric Values</title>
-
-      <para><programlisting>ceiling(xs:float(‘10.4’))</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>float n = ((XSFloat)rs.first()).floatvalue();
-println(n);</programlisting></para>
-
-      <para>In order to get the result of ‘11.0’</para>
-    </section>
-
-    <section id="Functions_to_Assemble_and_Disassemble_Strings">
-      <title>Functions to Assemble and Disassemble Strings</title>
-
-      <para><programlisting>codepoints-to-string(0111)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XSString)rs.first()).stringvalue();
-println(n);&lt;/source&gt;</programlisting></para>
-
-      <para>In order to get the result of ‘o’</para>
-    </section>
-
-    <section id="Compare_and_Other_Functions_on_String_Values">
-      <title>Compare and Other Functions on String Values</title>
-
-      <para><programlisting>concat(‘un’, ‘grateful’)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XSString)rs.first()).stringvalue();
-println(n);</programlisting></para>
-
-      <para>In order to get the result of ‘ungrateful’</para>
-    </section>
-
-    <section id="Functions_Based_on_Substring_Matching">
-      <title>Functions Based on Substring Matching</title>
-
-      <para><programlisting>contains("abc", "edf")</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>boolean n = ((XSBoolean)rs.first()).value();
-println(n);</programlisting></para>
-
-      <para>In order to get the result of ‘false’</para>
-    </section>
-
-    <section id="String_Functions_that_Use_Pattern_Matching">
-      <title>String Functions that Use Pattern Matching</title>
-
-      <para><programlisting>matches(‘abcd’, ‘abcd’)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>boolean n = ((XSBoolean)rs.first()).value();
-println(n);</programlisting></para>
-
-      <para>In order to get the result of ‘true’</para>
-    </section>
-
-    <section id="Functions_on_Boolean_Values">
-      <title>Functions on Boolean Values</title>
-
-      <para><programlisting>not(true())</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>boolean n = ((XSBoolean)rs.first()).value();
-println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘false’</para>
-    </section>
-
-    <section id="Component_Extraction_Functions_on_Durations.2C_Dates_and_Times">
-      <title>Component Extraction Functions on Durations, Dates and
-      Times</title>
-
-      <para><programlisting>timezone-from-time(xs:time("13:20:00+05:00"))</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); 
-println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘PT5H’</para>
-    </section>
-
-    <section id="Functions_Related_to_QNames">
-      <title>Functions Related to QNames</title>
-
-      <para><programlisting>local-name-from-QName(QName(‘ <ulink
-            url="http://www.example.com/example">http://www.example.com/example</ulink>’, ‘person’))</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XSNCName)rs.first()).stringvalue();
-println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘person’</para>
-    </section>
-
-    <section id="Functions_on_Nodes">
-      <title>Functions on Nodes</title>
-
-      <para></para>
-
-      <section id="General_Functions_on_Sequences">
-        <title>General Functions on Sequences</title>
-
-        <para><programlisting>remove((‘s’,‘o’,‘m’,‘e’,‘t’,‘h’,‘i’,‘n’,‘g’), 6)</programlisting></para>
-
-        <para>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</para>
-
-        <programlisting>for (Iterator iter = rs.iterator(); iter.hasNext();) {
-  Object item = iter.next(); 
+					<emphasis role="italic">'result: '</emphasis> 
+				</para>
+				<orderedlist>
+					<listitem>
+						<para>text: </para>
+					</listitem>
+					<listitem>
+						<para>element: is </para>
+					</listitem>
+					<listitem>
+						<para>comment: life sux </para>
+					</listitem>
+					<listitem>
+						<para>text:</para>
+					</listitem>
+				</orderedlist>
+				<para>
+</para>
+			</section>
+		</section>
+	</chapter>
+	<chapter id="How_to_use_XPath_2.0_functions_with_PsychoPath">
+		<title>How to use XPath 2.0 functions with PsychoPath</title>
+		<para>The aim of this section is to give the user an overview of the available XPath 2.0 functions that are implemented in PsychoPath. For the formal specifications, see the W3C web-site for XPath 2.0 functions and operators 
+			<ulink url="http://www.w3.org/TR/xpath-functions/">http://www.w3.org/TR/xpath-functions/</ulink>.
+			 
+		</para>
+		<section id="Accessors">
+			<title>Accessors</title>
+			<para>In order for PsychoPath to operate on instances of the XPath 2.0 data model, the model must expose the properties of the items it contains. It does this by defining a family of accessor functions. These functions are not available to users or applications to call directly. Instead, they are descriptions of the information that an implementation of the model must expose to applications. </para>
+			<literallayout>data(‘string’)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XSString)rs.first()).stringvalue(); println(n);</para>
+			<para>in order to get the result of ‘string’</para>
+		</section>
+		<section id="Constructor_Functions">
+			<title>Constructor Functions</title>
+			<literallayout>xs:dateTime("2002-02-01T10:00:00+06:00")
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XSDateTime)rs.first()).stringvalue(); println(n);</para>
+			<para>in order to get the result of ‘2002-02-01T04:00:00Z’</para>
+		</section>
+		<section id="Functions_on_Numeric_Values">
+			<title>Functions on Numeric Values</title>
+			<literallayout>ceiling(xs:float(‘10.4’))
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>float n = ((XSFloat)rs.first()).floatvalue(); println(n);</para>
+			<para>in order to get the result of ‘11.0’ </para>
+		</section>
+		<section id="Functions_to_Assemble_and_Disassemble_Strings">
+			<title>Functions to Assemble and Disassemble Strings</title>
+			<literallayout>codepoints-to-string(0111)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XSString)rs.first()).stringvalue(); println(n);</para>
+			<para>in order to get the result of ‘o’</para>
+		</section>
+		<section id="Compare_and_Other_Functions_on_String_Values">
+			<title>Compare and Other Functions on String Values</title>
+			<literallayout>concat(‘un’, ‘grateful’)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XSString)rs.first()).stringvalue(); println(n);</para>
+			<para>in order to get the result of ‘ungrateful’</para>
+		</section>
+		<section id="Functions_Based_on_Substring_Matching">
+			<title>Functions Based on Substring Matching</title>
+			<literallayout>contains("abc", "edf")
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>boolean n = ((XSBoolean)rs.first()).value(); println(n);</para>
+			<para>in order to get the result of ‘false’</para>
+		</section>
+		<section id="String_Functions_that_Use_Pattern_Matching">
+			<title>String Functions that Use Pattern Matching</title>
+			<literallayout>matches(‘abcd’, ‘abcd’)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>boolean n = ((XSBoolean)rs.first()).value(); println(n);</para>
+			<para>in order to get the result of ‘true’</para>
+		</section>
+		<section id="Functions_on_Boolean_Values">
+			<title>Functions on Boolean Values</title>
+			<literallayout>not(true())
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>
+				boolean n = ((XSBoolean)rs.first()).value();
+				println(n);
+				</para>
+			<para>in order to get the result of ‘false’</para>
+		</section>
+		<section id="Component_Extraction_Functions_on_Durations.2C_Dates_and_Times">
+			<title>Component Extraction Functions on Durations, Dates and Times</title>
+			<literallayout>timezone-from-time(xs:time("13:20:00+05:00"))
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); println(n);</para>
+			<para>in order to get the result of ‘PT5H’</para>
+		</section>
+		<section id="Functions_Related_to_QNames">
+			<title>Functions Related to QNames</title>
+			<literallayout>local-name-from-QName(QName(‘http://www.example.com/example’, ‘person’))
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XSNCName)rs.first()).stringvalue(); println(n); </para>
+			<para>in order to get the result of ‘person’</para>
+		</section>
+		<section id="Functions_on_Nodes">
+			<title>Functions on Nodes</title>
+			<section id="General_Functions_on_Sequences">
+				<title>General Functions on Sequences</title>
+				<literallayout>remove((‘s’,‘o’,‘m’,‘e’,‘t’,‘h’,‘i’,‘n’,‘g’), 6)
+</literallayout>
+				<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+				<para>
+					for (Iterator iter = rs.iterator(); iter.hasNext();) {</para>
+				<literallayout>  Object item = iter.next(); 
   String n = ((XSString)item).stringvalue();
   print(n + " ");
-} println("");
-</programlisting>
-
-        <para>in order to get the result of ‘s o m e t i n g’</para>
-      </section>
-
-      <section id="Functions_That_Test_the_Cardinality_of_Sequences">
-        <title>Functions That Test the Cardinality of Sequences</title>
-
-        <para><programlisting>one-or-more((1,2,3,4,5))</programlisting></para>
-
-        <para>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</para>
-
-        <programlisting>for (Iterator iter = rs.iterator(); iter.hasNext();) {
- Object item = iter.next();
+</literallayout>
+				<para>}
+					println(""); 
+					</para>
+				<para>in order to get the result of ‘s o m e t i n g’</para>
+			</section>
+			<section id="Functions_That_Test_the_Cardinality_of_Sequences">
+				<title>Functions That Test the Cardinality of Sequences</title>
+				<literallayout>one-or-more((1,2,3,4,5))
+</literallayout>
+				<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+				<para>
+					for (Iterator iter = rs.iterator(); iter.hasNext();) {</para>
+				<literallayout> Object item = iter.next();
  int n = ((XSInteger)item).intvalue();
  print(n + " ");
-} println("");
-</programlisting>
-
-        <para>in order to get the result of ‘1 2 3 4 5’</para>
-      </section>
-
-      <section id="Deep-Equal.2C_Aggregate_Functions.2C_and_Functions_that_Generate_Sequences">
-        <title>Deep-Equal, Aggregate Functions, and Functions that Generate
-        Sequences</title>
-
-        <para><programlisting>avg((3,4,5))</programlisting></para>
-
-        <para>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</para>
-
-        <para><programlisting>double avg = ((XSDouble)rs.first()).doublevalue();
-println(avg);</programlisting></para>
-
-        <para>in order to get the result of ‘4.0’</para>
-      </section>
-
-      <section id="Context_Functions">
-        <title>Context Functions</title>
-
-        <para><programlisting>(10 to 20) = 2</programlisting></para>
-
-        <para>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</para>
-
-        <para><programlisting>int pos = ((XSInteger)rs.first()).intvalue(); println(pos);</programlisting></para>
-
-        <para>in order to get the result of ‘11’</para>
-      </section>
-    </section>
-  </chapter>
-
-  <chapter id="How_to_use_XPath_2.0_operators_with_PsychoPath">
-    <title>How to use XPath 2.0 operators with PsychoPath</title>
-
-    <para>The aim of this section is to give the user an overview of the
-    available XPath 2.0 operators that are implemented in PsychoPath. For the
-    formal specifications, see the W3C web-site for XPath 2.0 functions and
-    operators <ulink
-    url="http://www.w3.org/TR/xpath-functions/">http://www.w3.org/TR/xpath-functions/</ulink>.</para>
-
-    <para></para>
-
-    <section id="Operators_on_Numeric_Values">
-      <title>Operators on Numeric Values</title>
-
-      <para><programlisting>xs:integer(4) + xs:integer(3)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>Integer n = ((XSInteger)rs.first()).integervalue(); 
-println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘7’</para>
-    </section>
-
-    <section id="Comparison_of_Numeric_Values">
-      <title>Comparison of Numeric Values</title>
-
-      <para><programlisting>xs:decimal(3.3) = xs:decimal(6.6)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>boolean n = ((XSBoolean)rs.first()).value(); println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘false’</para>
-    </section>
-
-    <section id="Operators_on_Boolean_Values">
-      <title>Operators on Boolean Values</title>
-
-      <para><programlisting>xs:boolean(’true’) gt xs:boolean(’false’)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>boolean n = ((XSBoolean)rs.first()).value(); println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘true’</para>
-    </section>
-
-    <section id="Comparisons_of_Duration.2C_Date_and_Time_Values">
-      <title>Comparisons of Duration, Date and Time Values</title>
-
-      <para><programlisting>xs:time("23:00:00+06:00") lt xs:time("12:00:00-06:00")</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>boolean n = ((XSBoolean)rs.first()).value(); 
-println(n);</programlisting></para>
-
-      <para>in order to get the result of ‘true’</para>
-    </section>
-
-    <section id="Arithmetic_Functions_on_Durations">
-      <title>Arithmetic Functions on Durations</title>
-
-      <para><programlisting>multiply-dayTimeDuration(xs:dayTimeDuration("PT2H10M"), 2.1)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); 
-println(n);</programlisting></para>
-
-      <para>which returns a xdt:dayTimeDuration value corresponding to 4 hours
-      and 33 minutes ‘PT4H33M’</para>
-    </section>
-
-    <section id="Arithmetic_Functions_Dates_and_Times">
-      <title>Arithmetic Functions Dates and Times</title>
-
-      <para><programlisting>add-yearMonthDuration-to-dateTime( xs:dateTime("2000-10-30T11:12:00"), xdt:yearMonthDuration("P1Y2M"))</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>String n = ((XSDateTime)rs.first()).stringvalue(); 
-println(n);</programlisting></para>
-
-      <para>which returns an xs:dateTime value corresponding to the lexical
-      representation ‘2001-12-30T11:12:00’</para>
-    </section>
-
-    <section id="Operators_Related_to_QNames_And_Nodes">
-      <title>Operators Related to QNames And Nodes</title>
-
-      <para><programlisting>xs:QName(’ao’) eq xs:QName(’ao’)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>boolean n = ((XSBoolean)rs.first()).value(); 
-println(n);</programlisting></para>
-
-      <para>which returns the result of ‘true’</para>
-    </section>
-
-    <section id="Union.2C_Intersection_and_Except">
-      <title>Union, Intersection and Except</title>
-
-      <para><programlisting>union($seq2, $seq3)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <programlisting>for (Iterator iter = rs.iterator(); iter.hasNext();) {
-  Object item = iter.next();
-  String n = ((XSString)item).stringvalue();
-  print(n + ", ");
-}
-println("");
-</programlisting>
-
-      <para> </para>
-
-      <para>which returns the sequence consisting of $item1, $item2,
-      $item3.</para>
-
-      <para></para>
-    </section>
-
-    <section id="Operators_that_Generate_Sequences">
-      <title>Operators that Generate Sequences</title>
-
-      <para><programlisting>(1 to 3)</programlisting></para>
-
-      <para>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</para>
-
-      <para><programlisting>int n = (XSInteger)rs.first()).stringvalue(); 
-println(n);</programlisting></para>
-
-      <para>which returns the sequence consisting of 1, 2, 3.</para>
-    </section>
-  </chapter>
-</book>
+</literallayout>
+				<para>}
+					println(""); 
+					</para>
+				<para>in order to get the result of ‘1 2 3 4 5’</para>
+			</section>
+			<section id="Deep-Equal.2C_Aggregate_Functions.2C_and_Functions_that_Generate_Sequences">
+				<title>Deep-Equal, Aggregate Functions, and Functions that Generate Sequences</title>
+				<literallayout>avg((3,4,5))
+</literallayout>
+				<para> </para>
+				<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+				<para>double avg = ((XSDouble)rs.first()).doublevalue(); println(avg); </para>
+				<para>in order to get the result of ‘4.0’</para>
+			</section>
+			<section id="Context_Functions">
+				<title>Context Functions</title>
+				<literallayout>(10 to 20)[position() = 2]
+</literallayout>
+				<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+				<para>int pos = ((XSInteger)rs.first()).intvalue(); println(pos);</para>
+				<para>in order to get the result of ‘11’</para>
+			</section>
+		</section>
+	</chapter>
+	<chapter id="How_to_use_XPath_2.0_operators_with_PsychoPath">
+		<title>How to use XPath 2.0 operators with PsychoPath</title>
+		<para>The aim of this section is to give the user an overview of the available XPath 2.0 operators that are implemented in PsychoPath. For the formal specifications, see the W3C web-site for XPath 2.0 functions and operators 
+			<ulink url="http://www.w3.org/TR/xpath-functions/">http://www.w3.org/TR/xpath-functions/</ulink>. 
+		</para>
+		<para>
+			 </para>
+		<section id="Operators_on_Numeric_Values">
+			<title>Operators on Numeric Values</title>
+			<literallayout>xs:integer(4) + xs:integer(3)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>Integer n = ((XSInteger)rs.first()).integervalue(); println(n);</para>
+			<para>in order to get the result of ‘7’</para>
+		</section>
+		<section id="Comparison_of_Numeric_Values">
+			<title>Comparison of Numeric Values</title>
+			<literallayout>xs:decimal(3.3) = xs:decimal(6.6)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>boolean n = ((XSBoolean)rs.first()).value(); println(n);</para>
+			<para>in order to get the result of ‘false’</para>
+		</section>
+		<section id="Operators_on_Boolean_Values">
+			<title>Operators on Boolean Values</title>
+			<literallayout>xs:boolean(’true’) gt xs:boolean(’false’)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>boolean n = ((XSBoolean)rs.first()).value(); println(n); </para>
+			<para>in order to get the result of ‘true’</para>
+		</section>
+		<section id="Comparisons_of_Duration.2C_Date_and_Time_Values">
+			<title>Comparisons of Duration, Date and Time Values</title>
+			<literallayout>xs:time("23:00:00+06:00") lt xs:time("12:00:00-06:00")
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>boolean n = ((XSBoolean)rs.first()).value(); println(n);</para>
+			<para>in order to get the result of ‘true’</para>
+		</section>
+		<section id="Arithmetic_Functions_on_Durations">
+			<title>Arithmetic Functions on Durations</title>
+			<literallayout>multiply-dayTimeDuration(xdt:dayTimeDuration("PT2H10M"), 2.1)
+</literallayout>
+			<para> </para>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); println(n);</para>
+			<para>which returns a xdt:dayTimeDuration value corresponding to 4 hours and 33 minutes ‘PT4H33M’</para>
+		</section>
+		<section id="Arithmetic_Functions_Dates_and_Times">
+			<title>Arithmetic Functions Dates and Times</title>
+			<literallayout>add-yearMonthDuration-to-dateTime( xs:dateTime("2000-10-30T11:12:00"), xdt:yearMonthDuration("P1Y2M"))
+</literallayout>
+			<para> </para>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>String n = ((XSDateTime)rs.first()).stringvalue(); println(n);</para>
+			<para>which returns an xs:dateTime value corresponding to the lexical representation ‘2001-12-30T11:12:00’</para>
+		</section>
+		<section id="Operators_Related_to_QNames_And_Nodes">
+			<title>Operators Related to QNames And Nodes</title>
+			<literallayout>xs:QName(’ao’) eq xs:QName(’ao’)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>boolean n = ((XSBoolean)rs.first()).value(); println(n);</para>
+			<para>which returns the result of ‘true’</para>
+		</section>
+		<section id="Union.2C_Intersection_and_Except">
+			<title>Union, Intersection and Except</title>
+			<literallayout>union($seq2, $seq3)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>
+				for (Iterator iter = rs.iterator(); iter.hasNext();) {</para>
+			<literallayout>Object item = iter.next();
+String n = ((XSString)item).stringvalue();
+print(n + ", ");
+</literallayout>
+			<para>}
+				println(""); 
+				</para>
+			<para>which returns the sequence consisting of $item1, $item2, $item3. </para>
+			<para>
+</para>
+		</section>
+		<section id="Operators_that_Generate_Sequences">
+			<title>Operators that Generate Sequences</title>
+			<literallayout>(1 to 3)
+</literallayout>
+			<para>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </para>
+			<para>int n = (XSInteger)rs.first()).stringvalue(); println(n);</para>
+			<para>which returns the sequence consisting of 1, 2, 3. </para>
+			<itemizedlist>
+				<listitem>
+					<para></para>
+					<itemizedlist>
+						<listitem>
+							<para></para>
+							<itemizedlist>
+								<listitem>
+									<para>-</para>
+								</listitem>
+							</itemizedlist>
+						</listitem>
+					</itemizedlist>
+				</listitem>
+			</itemizedlist>
+			<para>
+				<ulink url="/wiki/Category:Draft_Documentation">Category:Draft_Documentation</ulink>
+			</para>
+		</section>
+	</chapter>
+</book>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/book.css b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/book.css
index f4c35e7..27186e5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/book.css
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/book.css
@@ -86,6 +86,17 @@
 	font-family: "Courier New", Courier, monospace;
 }
 
+div.literallayout {
+	font-family: "Courier New", Courier, monospace;
+	background-color: silver;
+	border: thin;
+	border-style: dashed;
+	color: black;
+	padding-left: 5;
+}
+div.literallayout p {
+	font-family: "Courier New", Courier, monospace;
+}
 /* end font face declarations */
 @media print {
 	html {
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch01.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch01.html
index 3435cf1..ae133c8 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch01.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch01.html
@@ -1,20 +1,5 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Introduction</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="prev" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="next" href="ch02.html" title="Using PsychoPath XPath 2.0 API"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Introduction"></a>Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch01.html#Getting_PsychoPath">Getting PsychoPath</a></span></li></ul></div><p>What is PsychohPath? PsychoPath is a XPath 2.0 XML Schema Aware
-    processor. It is nearly fully compliant to the XPath 2.0 test suite. It is
-    a library that does not require eclipse to be used. Known adopters of
-    PsychoPath include the Xerces-J project for XML Schemas 1.1 assertion
-    support.</p><p>PsychoPath is the only known open-source java XPath 2.0 processor
-    that is fully schema aware. SAXON HE only supports the core functionality.
-    XML Schema awarness provides tighter static checking, and can be used to
-    help determine if certain operations can or should occur on an XML node.
-    For a detailed description of the PsychoPath's design please see the
-    <a class="ulink" href="/PsychoPathXPathProcessor/Design" target="_top">design</a>
-    document.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Getting_PsychoPath"></a>Getting PsychoPath</h2></div></div></div><p>Currently there is no standalone build of PsychoPath. However, you
-      can download the <a class="ulink" href="http://download.eclipse.org/webtools/downloads/drops/R3.1/R-3.1-20090616035105/" target="_top">WTP
-      WST 3.1</a> zip file, and use the
-      org.eclipse.wst.xml.xpath2.processor.jar file. This jar has no
-      dependencies on eclipse, and will work as a standard jar file. If you
-      are using an OSGI container, then this is treated as a standard OSGI
-      bundle.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">PsychoPath 1.1M1</h3><p>PsychoPath 1.1M1 is also available to <a class="ulink" href="http://download.eclipse.org/webtools/downloads/drops/R3.2/S-3.2M1b-20090814143519/" target="_top">download</a>.
-        1.1M1 passes 96% of the XPath 2.0 test suite.</p></div><p>Additional dependencies you currently need are:</p><div class="itemizedlist"><ul type="disc"><li><p>IBM ICU 4.0 or greater</p></li><li><p>Xerces 2.8.0 or greater</p></li><li><p>JavaCup 0.10 or greater.</p></li></ul></div><p>If using eclipse, these are all available from the Orbit project.
-      Others can find the necessary jars from their respective project
-      pages.</p></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Introduction</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="index.html" title="usermanual"><link rel="prev" href="index.html" title="usermanual"><link rel="next" href="ch02.html" title="How to feed Psychopath XPath expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" title="Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="Introduction"></a>Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch01.html#Getting_PsychoPath">Getting PsychoPath</a></span></li></ul></div><p>What is PsychohPath?   PsychoPath is a XPath 2.0 XML Schema Aware processor.  It is nearly fully compliant to the XPath 2.0 test suite.  It is a library that does not require eclipse to be used.   Known adopters of PsychoPath include the Xerces-J project for XML Schemas 1.1 assertion support.</p><p>PsychoPath is the only known open-source java XPath 2.0 processor that is fully schema aware.   SAXON HE only supports the core functionality.   XML Schema awarness provides tighter static checking, and can be used to help determine if certain operations can or should occur on an XML node.   For a detailed description of the PsychoPath's design please see the 
+			<a class="ulink" href="/wiki/PsychoPathXPathProcessor/Design" target="_top">design</a> document.
+		</p><div class="section" title="Getting PsychoPath"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Getting_PsychoPath"></a>Getting PsychoPath</h2></div></div></div><p>Standalone jars are only available through nightly builds.  However, you can download the current WTP builds, and use the org.eclipse.wst.xml.xpath2.processor.jar file.   This jar has no dependencies on eclipse, and will work as a standard jar file.  If you are using an OSGI container, then this is treated as a standard OSGI bundle.</p><p>Additional dependencies you currently need are:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>IBM ICU 3.8</p></li><li class="listitem"><p>Xerces 2.8.0 or greater</p></li><li class="listitem"><p>JavaCup 0.10 or greater.</p></li></ul></div><p>These are all available from the 
+				<a class="ulink" href="http://download.eclipse.org/tools/orbit/downloads/" target="_top">Orbit project.</a>
+			</p></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02.html
index 7f1ac76..1fd09dc 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02.html
@@ -1,70 +1,32 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Using PsychoPath XPath 2.0 API</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="prev" href="ch01.html" title="Introduction"><link rel="next" href="ch02s02.html" title="Schema Aware"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="How_to_feed_Psychopath_XPath_expressions"></a>Using PsychoPath XPath 2.0 API</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch02.html#Non-Schema_Aware">Non-Schema Aware</a></span></li><li><span class="section"><a href="ch02s02.html">Schema Aware</a></span></li><li><span class="section"><a href="ch02s03.html">How to use the XPath 2.0 grammar with PsychoPath</a></span><ul><li><span class="section"><a href="ch02s03.html#Constants">Constants</a></span></li><li><span class="section"><a href="ch02s03s02.html">Path expressions</a></span></li><li><span class="section"><a href="ch02s03s03.html">Axis steps</a></span></li><li><span class="section"><a href="ch02s03s04.html">Set difference, intersection and Union</a></span></li><li><span class="section"><a href="ch02s03s05.html">Arithmetic Expressions</a></span><ul><li><span class="section"><a href="ch02s03s05.html#Unary">Unary</a></span></li><li><span class="section"><a href="ch02s03s05s02.html">Multiplication and Division:</a></span></li><li><span class="section"><a href="ch02s03s05s03.html">Addition and Subtraction:</a></span></li></ul></li><li><span class="section"><a href="ch02s03s06.html">Range expressions</a></span></li><li><span class="section"><a href="ch02s03s07.html">Comparisons</a></span></li><li><span class="section"><a href="ch02s03s08.html">Conditional Expressions</a></span></li><li><span class="section"><a href="ch02s03s09.html">Quantified Expressions</a></span></li><li><span class="section"><a href="ch02s03s10.html">And, Or Expressions</a></span></li><li><span class="section"><a href="ch02s03s11.html">SequenceType Matching Expressions</a></span></li></ul></li></ul></div><p>Since PsychoPath has been implemented as an external library and not
-    as a complete program, in order to use it, it needs to be accessed from
-    inside another program. To process XPath 2.0 expressions using PsychoPath
-    from another programs one needs to go through the following
-    process:</p><div class="orderedlist"><ol type="1"><li><p>Load the XML document</p></li><li><p>Optionally validate the XML document</p></li><li><p>Initialize static and dynamic context in respect to the document
-        root</p></li><li><p>Parse the XPath 2.0 expression</p></li><li><p>Statically verify the XPath 2.0 expression</p></li><li><p>Evaluate the XPath 2.0 expression in respect to the XML
-        document</p></li></ol></div><p>To give a better idea of how this process actually works, we&rsquo;ll go
-    through an example of processing and evaluating the string expression
-    &ldquo;Hello World!&rdquo;. In this example the XML document that we load is called
-    &ldquo;XPexample.xml&rdquo;.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Non-Schema_Aware"></a>Non-Schema Aware</h2></div></div></div><pre class="programlisting">/**
- * First load and optionally validate the XML document 
-*/
-// Create an InputStream from the XML document
-InputStream is = new FileInputStream(&ldquo;XPexample.xml&rdquo;);
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>How to feed Psychopath XPath expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="index.html" title="usermanual"><link rel="prev" href="ch01.html" title="Introduction"><link rel="next" href="ch02s02.html" title="Schema Aware"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" title="How to feed Psychopath XPath expressions"><div class="titlepage"><div><div><h2 class="title"><a name="How_to_feed_Psychopath_XPath_expressions"></a>How to feed Psychopath XPath expressions</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch02.html#Non-Schema_Aware">Non-Schema Aware</a></span></li><li><span class="section"><a href="ch02s02.html">Schema Aware</a></span></li><li><span class="section"><a href="ch02s03.html">How to use the XPath 2.0 grammar with PsychoPath</a></span><ul><li><span class="section"><a href="ch02s03.html#Constants">Constants</a></span></li><li><span class="section"><a href="ch02s03s02.html">Path expressions</a></span></li><li><span class="section"><a href="ch02s03s03.html">Axis steps</a></span></li><li><span class="section"><a href="ch02s03s04.html">Set difference, intersection and Union</a></span></li><li><span class="section"><a href="ch02s03s05.html">Arithmetic Expressions</a></span><ul><li><span class="section"><a href="ch02s03s05.html#Unary">Unary</a></span></li><li><span class="section"><a href="ch02s03s05s02.html">Multiplication and Division:</a></span></li><li><span class="section"><a href="ch02s03s05s03.html">Addition and Subtraction:</a></span></li></ul></li><li><span class="section"><a href="ch02s03s06.html">Range expressions</a></span></li><li><span class="section"><a href="ch02s03s07.html">Comparisons</a></span></li><li><span class="section"><a href="ch02s03s08.html">Conditional Expressions</a></span></li><li><span class="section"><a href="ch02s03s09.html">Quantified Expressions</a></span></li><li><span class="section"><a href="ch02s03s10.html">And, Or Expressions</a></span></li><li><span class="section"><a href="ch02s03s11.html">SequenceType Matching Expressions</a></span></li></ul></li></ul></div><p>Since PsychoPath has been implemented as an external library and not as a complete program, in order to use it, it needs to be accessed from inside another program. To process XPath 2.0 expressions using PsychoPath from another programs one needs to go through the following process: </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Load the XML document </p></li><li class="listitem"><p>Optionally validate the XML document </p></li><li class="listitem"><p>Initialize static and dynamic context in respect to the document root </p></li><li class="listitem"><p>Parse the XPath 2.0 expression </p></li><li class="listitem"><p>Statically verify the XPath 2.0 expression </p></li><li class="listitem"><p>Evaluate the XPath 2.0 expression in respect to the XML document</p></li></ol></div><p>To give a better idea of how this process actually works, we&rsquo;ll go through an example of processing and evaluating the string expression &ldquo;Hello World!&rdquo;. In this example the XML document that we load is called &ldquo;XPexample.xml&rdquo;. </p><p>All 5 main steps have been explained in detail in 
+			<a class="ulink" href="/wiki/PsychoPathXPathProcessor/UserInterface" target="_top">User Interface</a>, so below is just a brief code summary:
+			 
+		</p><div class="section" title="Non-Schema Aware"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Non-Schema_Aware"></a>Non-Schema Aware</h2></div></div></div><div class="literallayout"><p>/**<br>
+*&nbsp;First&nbsp;load&nbsp;and&nbsp;optionally&nbsp;validate&nbsp;the&nbsp;XML&nbsp;document&nbsp;<br>
+*/<br>
+</p></div><div class="literallayout"><p>//&nbsp;Create&nbsp;an&nbsp;InputStream&nbsp;from&nbsp;the&nbsp;XML&nbsp;document<br>
+InputStream&nbsp;is&nbsp;=&nbsp;new&nbsp;FileInputStream("XPexample.xml");<br>
+</p></div><div class="literallayout"><p>//&nbsp;Initializing&nbsp;the&nbsp;Xerces&nbsp;DOM&nbsp;loader.<br>
+DOMLoader&nbsp;loader&nbsp;=&nbsp;new&nbsp;XercesLoader();<br>
+</p></div><div class="literallayout"><p>//&nbsp;Optionally&nbsp;set&nbsp;flag&nbsp;to&nbsp;validate&nbsp;XML&nbsp;document<br>
+//&nbsp;loader.set_validating(validate);<br>
+//&nbsp;Loads&nbsp;the&nbsp;XML&nbsp;document&nbsp;and&nbsp;stores&nbsp;the&nbsp;DOM&nbsp;root<br>
+Document&nbsp;doc&nbsp;=&nbsp;loader.load(is);<br>
+</p></div><div class="literallayout"><p>//&nbsp;Initialising&nbsp;the&nbsp;StaticContext&nbsp;using&nbsp;a&nbsp;builder&nbsp;with&nbsp;suitable&nbsp;defaults.<br>
+StaticContextBuilder&nbsp;scb&nbsp;=&nbsp;new&nbsp;StaticContextBuilder();<br>
+</p></div><div class="literallayout"><p>/**<br>
+&nbsp;*&nbsp;Parsing&nbsp;the&nbsp;XPath&nbsp;2.0&nbsp;expression&nbsp;into&nbsp;an&nbsp;executable&nbsp;expression,&nbsp;including<br>
+&nbsp;*&nbsp;a&nbsp;static&nbsp;check&nbsp;and&nbsp;verification.<br>
+&nbsp;*/<br>
+String&nbsp;xpathText&nbsp;=&nbsp;"string-join(//character/name,&nbsp;',&nbsp;')";<br>
+XPath2Expression&nbsp;expr&nbsp;=&nbsp;new&nbsp;Engine().parseExpression(xpathText,&nbsp;scb);<br>
+</p></div><div class="literallayout"><p>//&nbsp;Evaluates&nbsp;the&nbsp;XPath&nbsp;2.0&nbsp;expression,&nbsp;storing&nbsp;the&nbsp;result<br>
+//&nbsp;in&nbsp;the&nbsp;ResultSequence<br>
+ResultSequence&nbsp;rs&nbsp;=&nbsp;expr.evaluate(new&nbsp;DynamicContextBuilder(scb),<br>
+	new&nbsp;Object[]&nbsp;{&nbsp;doc&nbsp;});<br>
+</p></div><div class="literallayout"><p>for&nbsp;(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;rs.size();&nbsp;++i)&nbsp;{<br>
+	System.out.println("#"&nbsp;+&nbsp;i&nbsp;+&nbsp;":&nbsp;"&nbsp;+&nbsp;rs.value(i));<br>
+}<br>
+</p></div><p>
 
-// Initializing the Xerces DOM loader.
-DOMLoader loader = new XercesLoader();
-
-// Optionally set flag to validate XML document loader.setvalidating(validate);
-// Loads the XML document and stores the DOM root
-Document doc = loader.load(is);
-
-/**
- * Dynamic contexts must be initialised to defaults
- * dependent on the XML Schema.
-*/
-
-// Extracting the schema from DOM root of Xpexpression.xml.
-ElementPSVI rootPSVI = (ElementPSVI)doc.getDocumentElement();
-XSModel schema = rootPSVI.getSchemaInformation();
-
-// Initialising the DynamicContext.
-DynamicContext dc = new DefaultDynamicContext(schema, doc);
-
-// Register the namespaces of the XPath 2.0 predefined datatypes
-dc.addnamespace(&ldquo;xs&rdquo;,&rdquo;[http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema]&rdquo;);
-
-// Register the XPath 2.0 standard functions
-dc.addfunctionlibrary(new FnFunctionLibrary());
-dc.addfunctionlibrary(new XSCtrLibrary());
-
-/**
- * Parsing the XPath 2.0 expression into an AST representation
- */
-// Initialises PsychoPath&rsquo;s supplied parser.
-XPathParser xpp = new JflexCupParser();
-
-// Parses the XPath expression.
-XPath xp = xpp.parse(xpath);
-/**
- * Static check the AST to verift structural validity of  
- * XPath 2.0 expression
- */
-
-// Initializing StaticChecker.
-StaticChecker namecheck = new StaticNameResolver(sc);
-
-// Static Checking the Xpath expression &rsquo;Hello World!&rsquo; namecheck.check(xp);
-/**
- * Evaluate the XPath 2.0 expression
- */
- 
-// Initializing the evaluator with DynamicContext and the name
-// of the XML document XPexample.xml as parameters.
-Evaluator eval = new DefaultEvaluator(dc, doc);
- 
-// Evaluates the XPath 2.0 expression, storing the result
-// in the ResultSequence
-ResultSequence rs = eval.evaluate(xp); 
-</pre></div></div></body></html>
\ No newline at end of file
+</p></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s02.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s02.html
index 19a87cf..4edd97f 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s02.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s02.html
@@ -1,101 +1,53 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Schema Aware</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02.html" title="Using PsychoPath XPath 2.0 API"><link rel="prev" href="ch02.html" title="Using PsychoPath XPath 2.0 API"><link rel="next" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Schema_Aware"></a>Schema Aware</h2></div></div></div><p></p><pre class="programlisting">/**
- * First load and optionally validate the XML document 
-*/
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Schema Aware</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02.html" title="How to feed Psychopath XPath expressions"><link rel="prev" href="ch02.html" title="How to feed Psychopath XPath expressions"><link rel="next" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Schema Aware"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Schema_Aware"></a>Schema Aware</h2></div></div></div><div class="literallayout"><p>/**<br>
+&nbsp;*&nbsp;First&nbsp;load&nbsp;and&nbsp;optionally&nbsp;validate&nbsp;the&nbsp;XML&nbsp;document&nbsp;<br>
+&nbsp;*/<br>
+//&nbsp;Create&nbsp;an&nbsp;InputStream&nbsp;from&nbsp;the&nbsp;XML&nbsp;document<br>
+InputStream&nbsp;is&nbsp;=&nbsp;new&nbsp;FileInputStream("XPexample.xml");<br>
+</p></div><div class="literallayout"><p>SchemaFactory&nbsp;schemaFactory&nbsp;=&nbsp;new&nbsp;XMLSchemaFactory();<br>
+URL&nbsp;schemaURL&nbsp;=&nbsp;new&nbsp;File("XPexample.xsd").toURL();<br>
+Schema&nbsp;jaxpschema&nbsp;=&nbsp;schemaFactory.newSchema(schemaURL);<br>
+</p></div><div class="literallayout"><p>//&nbsp;Initializing&nbsp;the&nbsp;Xerces&nbsp;DOM&nbsp;loader.<br>
+DOMLoader&nbsp;loader&nbsp;=&nbsp;new&nbsp;XercesLoader(jaxpschema);<br>
+loader.set_validating(true);<br>
+</p></div><div class="literallayout"><p>//&nbsp;Optionally&nbsp;set&nbsp;flag&nbsp;to&nbsp;validate&nbsp;XML&nbsp;document<br>
+//&nbsp;loader.set_validating(validate);<br>
+//&nbsp;Loads&nbsp;the&nbsp;XML&nbsp;document&nbsp;and&nbsp;stores&nbsp;the&nbsp;DOM&nbsp;root<br>
+Document&nbsp;doc&nbsp;=&nbsp;loader.load(is);<br>
+</p></div><div class="literallayout"><p>//&nbsp;Initialising&nbsp;the&nbsp;StaticContext&nbsp;using&nbsp;a&nbsp;builder&nbsp;with&nbsp;suitable&nbsp;defaults.<br>
+StaticContextBuilder&nbsp;scb&nbsp;=&nbsp;new&nbsp;StaticContextBuilder();<br>
+scb.withNamespace("xs",&nbsp;"http://www.w3.org/2001/XMLSchema");<br>
+scb.withTypeModel(new&nbsp;XercesTypeModel(doc));<br>
+</p></div><div class="literallayout"><p>/**<br>
+&nbsp;*&nbsp;Parsing&nbsp;the&nbsp;XPath&nbsp;2.0&nbsp;expression&nbsp;into&nbsp;an&nbsp;executable&nbsp;expression,&nbsp;including<br>
+&nbsp;*&nbsp;a&nbsp;static&nbsp;check&nbsp;and&nbsp;verification.<br>
+&nbsp;*/<br>
+String&nbsp;xpathText&nbsp;=&nbsp;"for&nbsp;$elem&nbsp;in&nbsp;//*[.&nbsp;instance&nbsp;of&nbsp;xs:normalizedString]&nbsp;return&nbsp;concat(local-name($elem),&nbsp;'&nbsp;:&nbsp;',&nbsp;$elem/text())";<br>
+XPath2Expression&nbsp;expr&nbsp;=&nbsp;new&nbsp;Engine().parseExpression(xpathText,&nbsp;scb);<br>
+</p></div><div class="literallayout"><p>//&nbsp;Evaluates&nbsp;the&nbsp;XPath&nbsp;2.0&nbsp;expression,&nbsp;storing&nbsp;the&nbsp;result<br>
+//&nbsp;in&nbsp;the&nbsp;ResultSequence<br>
+ResultSequence&nbsp;rs&nbsp;=&nbsp;expr.evaluate(new&nbsp;DynamicContextBuilder(scb),<br>
+	new&nbsp;Object[]&nbsp;{&nbsp;doc&nbsp;});<br>
+</p></div><div class="literallayout"><p>for&nbsp;(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;rs.size();&nbsp;++i)&nbsp;{<br>
+	System.out.println("#"&nbsp;+&nbsp;i&nbsp;+&nbsp;":&nbsp;"&nbsp;+&nbsp;rs.value(i));<br>
+}<br>
+</p></div><p>XPath 2.0 defines everything to be a sequence of items, including the arguments to expressions and the result of operations. Thus, the overall result of an XPath expression evaluation is also a sequence of items. PsychoPath uses the class ResultSequence as a Collections wrapper to store these sequences and therefore, the result of an evaluation is of this type also. The ResultSequence consists of zero or more items; an item may be a node or a simple-value. &ldquo;Hello World!&rdquo; is an example of a single value with length 1. A general sequence could be written as (&ldquo;a&rdquo;, &ldquo;s&rdquo;, &ldquo;d&rdquo;, &ldquo;f&rdquo;). </p><p>Extraction of certain items from the ResultSequence class is described below, with details of the different operations that one might apply on the ResultSequence. Consider that &rsquo;rs&rsquo; is the ResultSequence, then: </p><p>// Will return the number of elements in the sequence, in this </p><div class="literallayout"><p>//&nbsp;case&nbsp;of&nbsp;&rsquo;Hello&nbsp;World!&rsquo;&nbsp;expression&nbsp;size&nbsp;=&nbsp;1.&nbsp;<br>
+</p></div><div class="literallayout"><p>rs.size();<br>
+</p></div><div class="literallayout"><p>//&nbsp;Will&nbsp;return&nbsp;the&nbsp;n&rsquo;th&nbsp;element&nbsp;in&nbsp;the&nbsp;sequence,&nbsp;in&nbsp;this&nbsp;case&nbsp;of&nbsp;<br>
+//&nbsp;&rsquo;Hello&nbsp;World!&rsquo;,&nbsp;if&nbsp;n&nbsp;=&nbsp;0,&nbsp;then&nbsp;it&nbsp;will&nbsp;return<br>
+//&nbsp;&ldquo;Hello&nbsp;World!&rdquo;.<br>
+</p></div><div class="literallayout"><p>rs.value(n);<br>
+</p></div><div class="literallayout"><p>//Will&nbsp;return&nbsp;true&nbsp;if&nbsp;the&nbsp;sequence&nbsp;is&nbsp;empty.<br>
+rs.empty();&nbsp;<br>
+</p></div><div class="literallayout"><p>//&nbsp;Will&nbsp;return&nbsp;the&nbsp;first&nbsp;element&nbsp;of&nbsp;the&nbsp;sequence,&nbsp;<br>
+//&nbsp;in&nbsp;this&nbsp;example&nbsp;it&nbsp;will&nbsp;return&nbsp;xs:string&nbsp;of&nbsp;&ldquo;Hello&nbsp;World!&rdquo;&nbsp;<br>
+rs.firstValue()&nbsp;<br>
+</p></div><p> 
 
- SchemaFactory schemaFactory = new XMLSchemaFactory();
- URL schemaURL = new File("XPexample.xsd").toURL();
- Schema jaxpschema = schemaFactory.newSchema(schemaURL);
-
-// Create an InputStream from the XML document
-InputStream is = new FileInputStream(&ldquo;XPexample.xml&rdquo;);
-
-// Initializing the Xerces DOM loader.
-DOMLoader loader = new XercesLoader(jaxpschema);
-
-// Optionally set flag to validate XML document loader.setvalidating(validate);
-// Loads the XML document and stores the DOM root
-Document doc = loader.load(is);
-
-/**
- * Dynamic contexts must be initialised to defaults
- * dependent on the XML Schema.
-*/
-
-// Initialising the DynamicContext.
-DynamicContext dc = new DefaultDynamicContext(jaxpschema, doc);
-
-// Register the namespaces of the XPath 2.0 predefined datatypes
-dc.addnamespace(&ldquo;xs&rdquo;,&rdquo;[http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema]&rdquo;);
-
-// Register the XPath 2.0 standard functions
-dc.addfunctionlibrary(new FnFunctionLibrary());
-dc.addfunctionlibrary(new XSCtrLibrary());
-
-/**
- * Parsing the XPath 2.0 expression into an AST representation
- */
-// Initialises PsychoPath&rsquo;s supplied parser.
-XPathParser xpp = new JflexCupParser();
-
-// Parses the XPath expression.
-XPath xp = xpp.parse(xpath);
-
-/**
- * Static check the AST to verift structural validity of  
- * XPath 2.0 expression
- */
-
-// Initilising StaticChecker.
-StaticChecker namecheck = new StaticNameResolver(sc);
-
-// Static Checking the Xpath expression &rsquo;Hello World!&rsquo; namecheck.check(xp);
-/**
- * Evaluate the XPath 2.0 expression
- */
-
-// Initialising the evaluator with DynamicContext and the name
-// of the XML document XPexample.xml as parameters.
-Evaluator eval = new DefaultEvaluator(dc, doc); 
-
-// Evaluates the XPath 2.0 expression, storing the result
-// in the ResultSequence
-ResultSequence rs = eval.evaluate(xp); 
-</pre><p>XPath 2.0 defines everything to be a sequence of items, including
-      the arguments to expressions and the result of operations. Thus, the
-      overall result of an XPath expression evaluation is also a sequence of
-      items. PsychoPath uses the class ResultSequence as a Collections wrapper
-      to store these sequences and therefore, the result of an evaluation is
-      of this type also. The ResultSequence consists of zero or more items; an
-      item may be a node or a simple-value. &ldquo;Hello World!&rdquo; is an example of a
-      single value with length 1. A general sequence could be written as (&ldquo;a&rdquo;,
-      &ldquo;s&rdquo;, &ldquo;d&rdquo;, &ldquo;f&rdquo;).</p><p>Extraction of certain items from the ResultSequence class is
-      described below, with details of the different operations that one might
-      apply on the ResultSequence. Consider that &rsquo;rs&rsquo; is the ResultSequence,
-      then:</p><p></p><pre class="programlisting">// Will return the number of elements in the sequence, in this
-// case of &rsquo;Hello World!&rsquo; expression size = 1.
-rs.size(); 
-
-// Will return the n&rsquo;th element in the sequence, in this case of
-// &rsquo;Hello World!&rsquo;, if n = 1, then it will return
-// XSString of &ldquo;Hello World!&rdquo;, but if n = 2, it will return
-// Empty Result.
-rs.get(n);
-
-//Will return true if the sequence is empty.
-rs.empty(); 
-
-// Will return the first element of the sequence, 
-// in this example it will return XSString of &ldquo;Hello World!&rdquo; 
-rs.first() 
-</pre><p>However, all the items extracted will be of the type&rsquo;s base class
-      AnyType and need to be casted into its actual subtype.</p><p>Certain operations always return a particular type and using this
-      knowledge, the extracted item can be immediately casted. In our example
-      &ldquo;Hello World!&rdquo; returns a string (easily known as it is inside the quotes
-      &rsquo; &rsquo; ), so this can safely be casted as such:</p><p><pre class="programlisting">XSString xsstring = XSString)(rs.first());</pre>The
-      actual result can now be extracted from this XSString in the following
-      manner: <pre class="programlisting">String str = xsstring.value();</pre></p><p>The details of how to cast extracted items from AnyType into their
-      actual subtypes with examples is in the next section on How to use each
-      production in the grammar.</p><p>However, if the expected return type is unknown or multiple types
-      are possible, the types hierarchy can be traversed in a breadth first
-      manner making use of the Java instanceof operator to ascertain the
-      actual type.&nbsp;</p></div></body></html>
\ No newline at end of file
+				 However, all the items extracted will be of the type&rsquo;s "native" value (statically known as Object) and need to be casted into its actual subtype. </p><p>Certain operations always return a particular type and using this knowledge, the extracted item can be immediately casted. In our example &ldquo;Hello World!&rdquo; returns a string (easily known as it is inside the quotes &rsquo; &rsquo; ), so this can safely be casted as such: 
+				</p><div class="literallayout"><p>String&nbsp;string&nbsp;=&nbsp;(String)(rs.value(0));<br>
+&nbsp;<br>
+</p></div><p>The details of how to cast extracted items from Object into their actual subtypes with examples is in the next section on How to use each production in the grammar. As an alternative, you can call
+				</p><div class="literallayout"><p>ItemType&nbsp;itype&nbsp;=&nbsp;rs.itemType(n);<br>
+Which&nbsp;will&nbsp;return&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;n'th&nbsp;item&nbsp;in&nbsp;the&nbsp;result&nbsp;sequence.<br>
+</p></div><p>
+</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03.html
index cba921f..62a5251 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03.html
@@ -1,25 +1,15 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>How to use the XPath 2.0 grammar with PsychoPath</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02.html" title="Using PsychoPath XPath 2.0 API"><link rel="prev" href="ch02s02.html" title="Schema Aware"><link rel="next" href="ch02s03s02.html" title="Path expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="How_to_use_the_XPath_2.0_grammar_with_PsychoPath"></a>How to use the XPath 2.0 grammar with PsychoPath</h2></div></div></div><p>In this section we will try to give you an overview of the XPath
-      2.0 grammar in general and how each production in the grammar should be
-      used with PsychoPath. For the formal specifications, see the W3C
-      web-site for XPath 2.0 specification <a class="ulink" href="http://www.w3.org/TR/xpath20" target="_top">http://www.w3.org/TR/xpath20</a>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Constants"></a>Constants</h3></div></div></div><p>String literals are written as &ldquo;Hello&rdquo; or &lsquo;Hello&rsquo;. In each case
-        the opposite kind of quotation mark can be used within the string: &lsquo;He
-        said &ldquo;Hello&rdquo; &rsquo; or &ldquo;London is a big city&rdquo;. To feed PsychoPath, &ldquo; &lsquo;Hello
-        World!&rsquo; &rdquo;or &ldquo; &ldquo;Hello World!&rdquo; &rdquo; can be used to feed it with strings.
-        Remember that the ResultSequence returns AnyType so since a string is
-        being expected as the result, first it has to be casted in the code
-        like this: <pre class="programlisting">XSString xsstring = (XSString)(rs.first());</pre>
-        Numeric constants follow the Java rules for decimal literals: for
-        example, 4 or 4.67; a negative number can be written as -3.05. The
-        numeric literal is taken as a double precision floating point number
-        if it uses scientific notation (e.g. 1.0e7), as a fixed point decimal
-        if it includes a decimal point, or as an integer otherwise. When
-        extracting number literals from the ResultSequence, possible types to
-        be returned include <span class="italic">XSDecima''l (e.g.&nbsp;:
-        xs:decimal: 4.67),''XSInteger ''(e.g.&nbsp;: xs:integer: 4) or
-        ''XSDouble</span> (e.g.&nbsp;: xs:double 1e0). All of which need to be
-        cast in the same manner as stated before: from AnyType to their
-        corresponding types.</p><p>There are no boolean constants as such: <span class="italic">true, false</span> instead the function calls
-        <span class="bold"><strong>true()</strong></span> and <span class="bold"><strong>false()</strong></span> are used.</p><p>Constants of other data types can be written using constructors.
-        These look like function calls but require a string literal as their
-        argument. For example, <span class="bold"><strong>xs:float(&ldquo;10.7&rdquo;)</strong></span> produces a single-precision
-        floating point number.</p></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>How to use the XPath 2.0 grammar with PsychoPath</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02.html" title="How to feed Psychopath XPath expressions"><link rel="prev" href="ch02s02.html" title="Schema Aware"><link rel="next" href="ch02s03s02.html" title="Path expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="How to use the XPath 2.0 grammar with PsychoPath"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="How_to_use_the_XPath_2.0_grammar_with_PsychoPath"></a>How to use the XPath 2.0 grammar with PsychoPath</h2></div></div></div><p>In this section we will try to give you an overview of the XPath 2.0 grammar in general and how each production in the grammar should be used with PsychoPath. For the formal specifications, see the W3C web-site for XPath 2.0 specification 
+				<a class="ulink" href="http://www.w3.org/TR/xpath20" target="_top">http://www.w3.org/TR/xpath20</a>.
+				 
+			</p><div class="section" title="Constants"><div class="titlepage"><div><div><h3 class="title"><a name="Constants"></a>Constants</h3></div></div></div><p>String literals are written as &ldquo;Hello&rdquo; or &lsquo;Hello&rsquo;. In each case the opposite kind of quotation mark can be used within the string: &lsquo;He said &ldquo;Hello&rdquo; &rsquo; or &ldquo;London is a big city&rdquo;. To feed PsychoPath, &ldquo; &lsquo;Hello World!&rsquo; &rdquo;or &ldquo; &ldquo;Hello World!&rdquo; &rdquo; can be used to feed it with strings. Remember that the ResultSequence returns AnyType so since a string is being expected as the result, first it has to be casted in the code like this: 
+					String xsstring = (String)(rs.firstValue()); 
+					Numeric constants follow the Java rules for decimal literals: for example, 4 or 4.67; a negative number can be written as -3.05. The numeric literal is taken as a double precision floating point number if it uses scientific notation (e.g. 1.0e7), as a fixed point decimal if it includes a decimal point, or as an integer otherwise. When extracting number literals from the ResultSequence, possible types to be returned include 
+					<span class="italic">BigDecima''l (e.g.&nbsp;: xs:decimal: 4.67),''Int ''(e.g.&nbsp;: xs:integer: 4) or ''XSDouble</span> (e.g.&nbsp;: xs:double 1e0). All of which need to be casted in the same manner as stated before: from AnyType to their corresponding types. 
+				</p><p>There are no boolean constants as such: 
+					<span class="italic">true, false</span> instead the function calls 
+					<span class="bold"><strong>true()</strong></span> and 
+					<span class="bold"><strong>false()</strong></span> are used. 
+				</p><p>Constants of other data types can be written using constructors. These look like function calls but require a string literal as their argument. For example, 
+					<span class="bold"><strong>xs:float(&ldquo;10.7&rdquo;)</strong></span> produces a single-precision floating point number.
+					 
+				</p></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s02.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s02.html
index a5ad00c..c0d9f72 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s02.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s02.html
@@ -1,20 +1,22 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Path expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="next" href="ch02s03s03.html" title="Axis steps"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Path_expressions"></a>Path expressions</h3></div></div></div><p>A path expression is a sequence of steps separated by the
-        <span class="bold"><strong>/''' or '''//</strong></span> operator. For example,
-        <span class="bold"><strong>../@desc</strong></span> selects the desc attribute
-        of the parent of the context node.</p><p>In XPath 2.0, path expressions have been generalized so that any
-        expression can be used as an operand of <span class="bold"><strong>/</strong></span>, (both on the left and the right), as long as
-        its value is a sequence of nodes. For example, it is possible to use a
-        union expression (in parentheses) or a call to the id()
-        function.</p><p>In practice, it only makes sense to use expressions on the right
-        of <span class="bold"><strong>"/"</strong></span> if they depend on the context
-        item. It is legal to write $x/$y provided both $x and $y are sequences
-        of nodes, but the result is exactly the same as writing <span class="bold"><strong> <span class="italic">./$y</span>
-        </strong></span>.</p><p>Note that the expressions <span class="bold"><strong>./$X</strong></span>
-        or <span class="bold"><strong>$X/.</strong></span> can be used to remove
-        duplicates from <span class="bold"><strong>$X</strong></span> and sort the
-        results into document order.</p><p>The operator <span class="bold"><strong>//</strong></span> is an
-        abbreviation for <span class="bold"><strong>/descendant-or-self::node()</strong></span>. An expression of
-        the form <span class="bold"><strong>/E</strong></span> is shorthand for
-        <span class="bold"><strong>root(.)/E</strong></span>, and the expression
-        <span class="bold"><strong>/''' on its own is shorthand for
-        '''root(.)</strong></span>.</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Path expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="next" href="ch02s03s03.html" title="Axis steps"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Path expressions"><div class="titlepage"><div><div><h3 class="title"><a name="Path_expressions"></a>Path expressions</h3></div></div></div><p>A path expression is a sequence of steps separated by the 
+					<span class="bold"><strong>/''' or '''//</strong></span> operator. For example, 
+					<span class="bold"><strong>../@desc</strong></span> selects the desc attribute of the parent of the context node. 
+				</p><p>In XPath 2.0, path expressions have been generalized so that any expression can be used as an operand of 
+					<span class="bold"><strong>/</strong></span>, (both on the left and the right), as long as its value is a sequence of nodes. For example, it is possible to use a union expression (in parentheses) or a call to the id() function. 
+				</p><p>In practice, it only makes sense to use expressions on the right of 
+					<span class="bold"><strong>"/"</strong></span> if they depend on the context item. It is legal to write $x/$y provided both $x and $y are sequences of nodes, but the result is exactly the same as writing 
+					<span class="bold"><strong>
+						<span class="italic">./$y</span>
+					</strong></span>. 
+				</p><p>Note that the expressions 
+					<span class="bold"><strong>./$X</strong></span> or 
+					<span class="bold"><strong>$X/.</strong></span> can be used to remove duplicates from 
+					<span class="bold"><strong>$X</strong></span> and sort the results into document order. 
+					 
+				</p><p>The operator 
+					<span class="bold"><strong>//</strong></span> is an abbreviation for 
+					<span class="bold"><strong>/descendant-or-self::node()</strong></span>. An expression of the form 
+					<span class="bold"><strong>/E</strong></span> is shorthand for 
+					<span class="bold"><strong>root(.)/E</strong></span>, and the expression 
+					<span class="bold"><strong>/''' on its own is shorthand for '''root(.)</strong></span>. 
+				</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s03.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s03.html
index b86638b..cb1c560 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s03.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s03.html
@@ -1,7 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Axis steps</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s02.html" title="Path expressions"><link rel="next" href="ch02s03s04.html" title="Set difference, intersection and Union"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Axis_steps"></a>Axis steps</h3></div></div></div><p>The basic primitive for accessing a source document is the axis
-        step. Axis steps may be combined into path expressions using the path
-        operators "/" and "//", and they may be filtered using filter
-        expressions in the same way as the result of any other
-        expression.</p><p>An axis step has the basic form axis::node-test, and selects
-        nodes on a given axis that satisfy the node-test. The axes available
-        are:</p><div class="orderedlist"><ol type="1"><li><p>element: age</p></li><li><p>element: age</p></li></ol></div><p>The rest of the axes act in the same manner.</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Axis steps</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s02.html" title="Path expressions"><link rel="next" href="ch02s03s04.html" title="Set difference, intersection and Union"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Axis steps"><div class="titlepage"><div><div><h3 class="title"><a name="Axis_steps"></a>Axis steps</h3></div></div></div><p>The basic primitive for accessing a source document is the axis step. Axis steps may be combined into path expressions using the path operators "/" and "//", and they may be filtered using filter expressions in the same way as the result of any other expression. </p><p>An axis step has the basic form axis::node-test, and selects nodes on a given axis that satisfy the node-test. The axes available are: </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>element: age </p></li><li class="listitem"><p>element: age</p></li></ol></div><p>The rest of the axes act in the same manner.
+					 </p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s04.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s04.html
index 9a0198f..74a9793 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s04.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s04.html
@@ -1,23 +1,30 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Set difference, intersection and Union</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s03.html" title="Axis steps"><link rel="next" href="ch02s03s05.html" title="Arithmetic Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Set_difference.2C_intersection_and_Union"></a>Set difference, intersection and Union</h3></div></div></div><p>The expression E1 except E2 selects all nodes that are in E1
-        unless they are also in E2. Both expressions must return sequences of
-        nodes. The results are returned in document order. For example, @*
-        except @note returns all attributes except the note attribute. The
-        expression E1 intersect E2 selects all nodes that are in both E1 and
-        E2. Both expressions must return sequences of nodes. The results are
-        returned in document order. The expression E1 union E2 selects all
-        nodes that are in either E1 or E2 or both. Both expressions must
-        return sequences of nodes. The results are returned in document order.
-        A complete example of the above expression would be as follows.
-        Consider an XML document which looks like this:</p><pre class="programlisting">&lt;nodes&gt;
-  &lt;a&gt;
-    &lt;connecteda&gt;A&lt;/connecteda&gt;
-    &lt;connecteda&gt;B&lt;/connecteda&gt;
-    &lt;connecteda&gt;C&lt;/connecteda&gt;
-  &lt;/a&gt;
-  &lt;b&gt;
-    &lt;connectedb&gt;B&lt;/connectedb&gt;
-    &lt;connectedb&gt;C&lt;/connectedb&gt;
-    &lt;connectedb&gt;D&lt;/connectedb&gt;
-  &lt;/b&gt;
-&lt;/nodes&gt;
-</pre><p>Then an example of each of the expressions would be:</p><p><pre class="programlisting">data(/a/*) union data(/b/*)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:string: A</p></li><li><p>xs:string: B</p></li><li><p>xs:string: C</p></li><li><p>xs:string: D</p></li></ol></div><p><pre class="programlisting">data(/a/*) intersect data(/b/*)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:string: B</p></li><li><p>xs:string: C</p></li></ol></div><p><pre class="programlisting">data(/a/*) except data(/b/*)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:string: D</p></li></ol></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Set difference, intersection and Union</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s03.html" title="Axis steps"><link rel="next" href="ch02s03s05.html" title="Arithmetic Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Set difference, intersection and Union"><div class="titlepage"><div><div><h3 class="title"><a name="Set_difference.2C_intersection_and_Union"></a>Set difference, intersection and Union</h3></div></div></div><p>The expression E1 except E2 selects all nodes that are in E1 unless they are also in E2. Both expressions must return sequences of nodes. The results are returned in document order. For example, @* except @note returns all attributes except the note attribute. The expression E1 intersect E2 selects all nodes that are in both E1 and E2. Both expressions must return sequences of nodes. The results are returned in document order. The expression E1 union E2 selects all nodes that are in either E1 or E2 or both. Both expressions must return sequences of nodes. The results are returned in document order. A complete example of the above expression would be as follows. Consider an XML document which looks like this: </p><div class="literallayout"><p>&lt;source&nbsp;lang="xml"&gt;<br>
+&lt;nodes&gt;<br>
+&nbsp;&nbsp;&lt;a&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&lt;connecteda&gt;A&lt;/connecteda&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&lt;connecteda&gt;B&lt;/connecteda&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&lt;connecteda&gt;C&lt;/connecteda&gt;<br>
+&nbsp;&nbsp;&lt;/a&gt;<br>
+&nbsp;&nbsp;&lt;b&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&lt;connectedb&gt;B&lt;/connectedb&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&lt;connectedb&gt;C&lt;/connectedb&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&lt;connectedb&gt;D&lt;/connectedb&gt;<br>
+&nbsp;&nbsp;&lt;/b&gt;<br>
+&lt;/nodes&gt;<br>
+</p></div><p> 
+					then an example of each of the expressions would be: </p><div class="literallayout"><p>data(/a/*)&nbsp;union&nbsp;data(/b/*)<br>
+</p></div><p> 
+
+					<span class="italic">'result: '</span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:string: A </p></li><li class="listitem"><p>xs:string: B </p></li><li class="listitem"><p>xs:string: C </p></li><li class="listitem"><p>xs:string: D
+</p></li></ol></div><div class="literallayout"><p>data(/a/*)&nbsp;intersect&nbsp;data(/b/*)<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:string: B </p></li><li class="listitem"><p>xs:string: C
+</p></li></ol></div><div class="literallayout"><p>data(/a/*)&nbsp;except&nbsp;data(/b/*)<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:string: D
+</p></li></ol></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05.html
index 56c1276..e67da97 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05.html
@@ -1,3 +1 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Arithmetic Expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s04.html" title="Set difference, intersection and Union"><link rel="next" href="ch02s03s05s02.html" title="Multiplication and Division:"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Arithmetic_Expressions"></a>Arithmetic Expressions</h3></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="Unary"></a>Unary</h4></div></div></div><p>minus and plus: The unary minus operator changes the sign of a
-          number. For example -1 is minus one, and -1e0 is the double value
-          negative -1.</p></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Arithmetic Expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s04.html" title="Set difference, intersection and Union"><link rel="next" href="ch02s03s05s02.html" title="Multiplication and Division:"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Arithmetic Expressions"><div class="titlepage"><div><div><h3 class="title"><a name="Arithmetic_Expressions"></a>Arithmetic Expressions</h3></div></div></div><div class="section" title="Unary"><div class="titlepage"><div><div><h4 class="title"><a name="Unary"></a>Unary</h4></div></div></div><p>minus and plus: The unary minus operator changes the sign of a number. For example -1 is minus one, and -1e0 is the double value negative -1. </p></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s02.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s02.html
index 74f1c81..f9fcdf6 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s02.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s02.html
@@ -1,11 +1,8 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Multiplication and Division:</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03s05.html" title="Arithmetic Expressions"><link rel="prev" href="ch02s03s05.html" title="Arithmetic Expressions"><link rel="next" href="ch02s03s05s03.html" title="Addition and Subtraction:"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="Multiplication_and_Division:"></a>Multiplication and Division:</h4></div></div></div><p>The operator * multiplies two numbers. If the operands are of
-          different types, XPath 2.0 specifications say that one of them is
-          promoted to the type of the other.&nbsp;The result is the same type as
-          the operands after promotion.</p><p>The operator div divides two numbers. Dividing two integers
-          produces a double; in other cases the result is the same type as the
-          operands.</p><p>The operator idiv performs integer division. For example, the
-          result of 10 idiv 3 is 3.</p><p>The mod operator returns the modulus (or remainder) after
-          division.</p><p>The operators * and div may also be used to multiply or divide
-          a range by a number.</p><p>For example, <span class="italic">(1 idiv 1 to
-          3)</span> returns the result: <span class="italic">xs:integer: 1, xs:integer: 2, xs:integer:
-          3</span></p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Multiplication and Division:</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03s05.html" title="Arithmetic Expressions"><link rel="prev" href="ch02s03s05.html" title="Arithmetic Expressions"><link rel="next" href="ch02s03s05s03.html" title="Addition and Subtraction:"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Multiplication and Division:"><div class="titlepage"><div><div><h4 class="title"><a name="Multiplication_and_Division:"></a>Multiplication and Division:</h4></div></div></div><p>The operator * multiplies two numbers. If the operands are of different types, XPath 2.0 specifications say that one of them is promoted to the type of the other.&nbsp;<span style="color: red">&lt;strike&gt;&lt;/strike&gt;</span> The result is the same type as the operands after promotion. </p><p>
+						 The operator div divides two numbers. Dividing two integers produces a double; in other cases the result is the same type as the operands. </p><p>
+						 The operator idiv performs integer division. For example, the result of 10 idiv 3 is 3. </p><p>
+						 The mod operator returns the modulus (or remainder) after division. </p><p>
+						 The operators * and div may also be used to multiply or divide a range by a number. </p><p>For example, 
+						<span class="italic">(1 idiv 1 to 3)</span> returns the result: 
+						<span class="italic">xs:integer: 1, xs:integer: 2, xs:integer: 3</span> 
+					</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s03.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s03.html
index 0434e26..f5af886 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s03.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s05s03.html
@@ -1,5 +1,45 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Addition and Subtraction:</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03s05.html" title="Arithmetic Expressions"><link rel="prev" href="ch02s03s05s02.html" title="Multiplication and Division:"><link rel="next" href="ch02s03s06.html" title="Range expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="Addition_and_Subtraction:"></a>Addition and Subtraction:</h4></div></div></div><p>The operators <span class="bold"><strong>+</strong></span> and <span class="italic">'-'</span> perform addition and subtraction of
-          numbers, in the usual way. Once again, if the operands are of
-          different types, XPath 2.0 specifications say one of them is
-          promoted but numeric type promotion is currently unsupported by
-          PsychoPath. The result is of the same type as the operands.</p><p>Examples of above would be:</p><p><pre class="programlisting"> -(5 + 7)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:integer: -12</p></li></ol></div><p><pre class="programlisting">-xs:float(&rsquo;1.23&rsquo;)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:float: -1.23</p></li></ol></div><p><pre class="programlisting">-xs:double(&rsquo;1.23&rsquo;)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:double: -1.23</p></li></ol></div><p><pre class="programlisting">(+5 - +7)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:integer: -2</p></li></ol></div><p><pre class="programlisting">(1 to 5 div 0 )</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="itemizedlist"><ul type="disc"><li><p>FAIL (division by zero!)</p></li></ul></div><p><pre class="programlisting">5*6*10*5*96 div 20 div 3 div 1</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:decimal: 2400.0</p></li></ol></div><p><pre class="programlisting">31 mod 15</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:integer: 1</p></li></ol></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Addition and Subtraction:</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03s05.html" title="Arithmetic Expressions"><link rel="prev" href="ch02s03s05s02.html" title="Multiplication and Division:"><link rel="next" href="ch02s03s06.html" title="Range expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Addition and Subtraction:"><div class="titlepage"><div><div><h4 class="title"><a name="Addition_and_Subtraction:"></a>Addition and Subtraction:</h4></div></div></div><p>The operators 
+						<span class="bold"><strong>+</strong></span> and 
+						<span class="italic">'-'</span> perform addition and subtraction of numbers, in the usual way. Once again, if the operands are of different types, XPath 2.0 specifications say one of them is promoted but numeric type promotion is currently unsupported by PsychoPath. The result is of the same type as the operands. 
+					</p><p>Examples of above would be: </p><div class="literallayout"><p>-(5&nbsp;+&nbsp;7)<br>
+</p></div><p> 
+
+						<span class="bold"><strong>result:</strong></span>
+						 
+					</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:integer: -12</p></li></ol></div><div class="literallayout"><p>-xs:float(&rsquo;1.23&rsquo;)<br>
+</p></div><p> 
+
+						<span class="bold"><strong>result:</strong></span>
+
+					</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:float: -1.23 
+</p></li></ol></div><div class="literallayout"><p>-xs:double(&rsquo;1.23&rsquo;)<br>
+</p></div><p> 
+
+						<span class="bold"><strong>result:</strong></span>
+
+					</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:double: -1.23 
+</p></li></ol></div><div class="literallayout"><p>(+5&nbsp;-&nbsp;+7)<br>
+</p></div><p> 
+
+						<span class="bold"><strong>result:</strong></span>
+
+					</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:integer: -2 
+</p></li></ol></div><div class="literallayout"><p>(1&nbsp;to&nbsp;5&nbsp;div&nbsp;0&nbsp;)<br>
+</p></div><p> 
+
+						<span class="bold"><strong>result:</strong></span> 
+
+					</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>FAIL (division by zero!) 
+</p></li></ul></div><div class="literallayout"><p>5*6*10*5*96&nbsp;div&nbsp;20&nbsp;div&nbsp;3&nbsp;div&nbsp;1<br>
+</p></div><p> 
+
+						<span class="bold"><strong>result:</strong></span>
+
+					</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:decimal: 2400.0 
+</p></li></ol></div><div class="literallayout"><p>31&nbsp;mod&nbsp;15<br>
+</p></div><p> 
+
+						<span class="bold"><strong>result:</strong></span> 
+
+					</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:integer: 1
+</p></li></ol></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s06.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s06.html
index 325296e..24e4546 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s06.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s06.html
@@ -1,4 +1,8 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Range expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s05s03.html" title="Addition and Subtraction:"><link rel="next" href="ch02s03s07.html" title="Comparisons"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Range_expressions"></a>Range expressions</h3></div></div></div><p>The expression E1 to E2 returns a sequence of integers. For
-        example, 1 to 5 returns the sequence 1, 2, 3, 4, 5. This is useful in
-        for expressions, for example the first five nodes of a node sequence
-        can be processed by writing for $i in 1 to 5 return (//x) <a class="ulink" href="$i" target="_top">$i</a>. Another example:</p><p><pre class="programlisting">(1+1 to 10)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:integer: 2</p></li><li><p>xs:integer: 3</p></li><li><p>xs:integer: 4</p></li><li><p>xs:integer: 5</p></li><li><p>xs:integer: 6</p></li><li><p>xs:integer: 7</p></li><li><p>xs:integer: 8</p></li><li><p>xs:integer: 9</p></li><li><p>xs:integer: 10</p></li></ol></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Range expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s05s03.html" title="Addition and Subtraction:"><link rel="next" href="ch02s03s07.html" title="Comparisons"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Range expressions"><div class="titlepage"><div><div><h3 class="title"><a name="Range_expressions"></a>Range expressions</h3></div></div></div><p>The expression E1 to E2 returns a sequence of integers. For example, 1 to 5 returns the sequence 1, 2, 3, 4, 5. This is useful in for expressions, for example the first five nodes of a node sequence can be processed by writing for $i in 1 to 5 return (//x)
+					<a class="ulink" href="$i" target="_top">$i</a>. Another example: 
+				</p><div class="literallayout"><p>(1+1&nbsp;to&nbsp;10)<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:integer: 2 </p></li><li class="listitem"><p>xs:integer: 3 </p></li><li class="listitem"><p>xs:integer: 4 </p></li><li class="listitem"><p>xs:integer: 5 </p></li><li class="listitem"><p>xs:integer: 6 </p></li><li class="listitem"><p>xs:integer: 7 </p></li><li class="listitem"><p>xs:integer: 8 </p></li><li class="listitem"><p>xs:integer: 9 </p></li><li class="listitem"><p>xs:integer: 10
+</p></li></ol></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s07.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s07.html
index b9f6dd2..f630053 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s07.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s07.html
@@ -1,39 +1,94 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Comparisons</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s06.html" title="Range expressions"><link rel="next" href="ch02s03s08.html" title="Conditional Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Comparisons"></a>Comparisons</h3></div></div></div><p>The simplest comparison operators are <span class="bold"><strong>eq</strong></span>, <span class="bold"><strong>ne</strong></span>,
-        <span class="bold"><strong>lt</strong></span>, <span class="bold"><strong>le</strong></span>, <span class="bold"><strong>gt</strong></span>,
-        <span class="bold"><strong>ge</strong></span>. These compare two atomic values
-        of the same type, for example two integers, two dates, or two strings.
-        (Collation hasn&rsquo;t been implemented in current version of PsychoPath).
-        If the operands are not atomic values, an error is raised.</p><p>The operators <span class="bold"><strong>=''',&nbsp;</strong></span>!='
-        <span class="italic">, '</span>&lt;=' <span class="italic">,
-        '</span>&gt; <span class="bold"><strong>, '''&lt;</strong></span>, and
-        <span class="bold"><strong>&gt;=</strong></span> can compare arbitrary
-        sequences. The result is true if any pair of items from the two
-        sequences has the specified relationship, for example <span class="italic">$A = $B</span> is true if there is an item in
-        <span class="italic">$A</span> that is equal to some item in
-        <span class="italic">$B</span>.</p><p>The operators <span class="bold"><strong>is</strong></span> and <span class="bold"><strong>isnot</strong></span> test whether the operands represent the
-        same (identical) node. For example, <span class="italic">title
-        <a class="ulink" href="1" target="_top">1</a> is * <a class="ulink" href="@note" target="_top">@note</a> <a class="ulink" href="1" target="_top">1</a> </span> is true if the first title child is the
-        first child element that has a <span class="italic">@note</span> attribute. If either operand is an
-        empty sequence the result is an empty sequence (which will usually be
-        treated as false).</p><p>The operators <span class="bold"><strong>&lt;&lt;</strong></span> and
-        <span class="bold"><strong>&gt;&gt;</strong></span> test whether one node
-        precedes or follows another in document order. Consider this XML
-        document:</p><pre class="programlisting">&lt;book&gt;
- &lt;title&gt;Being a Dog Is a Full-Time Job&lt;/title&gt;
- &lt;author&gt;Charles M. Schulz&lt;/author&gt;
- &lt;character&gt;
-   &lt;name&gt;Snoopy&lt;/name&gt;
-   &lt;friend-of&gt;Peppermint Patty&lt;/friend-of&gt;
-   &lt;since&gt;1950-10-04&lt;/since&gt;
-   &lt;age&gt;2&lt;/age&gt;
-   &lt;qualification&gt;extroverted beagle&lt;/qualification&gt;
- &lt;/character&gt;
- &lt;character&gt;
-   &lt;name&gt;Peppermint Patty&lt;/name&gt;
-   &lt;since&gt;1966-08-22&gt;/since&gt;
-   &lt;age&gt;4&lt;/age&gt;
-   &lt;qualification&gt;bold, brash and tomboyish&lt;/qualification&gt;
- &lt;/character&gt;
-&lt;/book&gt;
-</pre><p>Example:</p><p><pre class="programlisting">book/character name="Snoopy" &lt;&lt; book/character Patty" </pre></p><p><span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:boolean: true</p></li></ol></div><p>book/character <a class="ulink" href="name=%22Peppermint" target="_top">Patty"</a>
-        &lt;&lt; book/character <a class="ulink" href="name=%22Snoopy%22" target="_top">name="Snoopy"</a> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:boolean: false</p></li></ol></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Comparisons</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s06.html" title="Range expressions"><link rel="next" href="ch02s03s08.html" title="Conditional Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Comparisons"><div class="titlepage"><div><div><h3 class="title"><a name="Comparisons"></a>Comparisons</h3></div></div></div><p>The simplest comparison operators are 
+					<span class="bold"><strong>eq</strong></span>, 
+					<span class="bold"><strong>ne</strong></span>, 
+					<span class="bold"><strong>lt</strong></span>, 
+					<span class="bold"><strong>le</strong></span>, 
+					<span class="bold"><strong>gt</strong></span>, 
+					<span class="bold"><strong>ge</strong></span>. These compare two atomic values of the same type, for example two integers, two dates, or two strings. (Collation hasn&rsquo;t been implemented in current version of PsychoPath). If the operands are not atomic values, an error is raised. 
+				</p><p>The operators 
+					<span class="bold"><strong>=''',&nbsp;</strong></span>!='
+					<span class="italic">, '</span>&lt;='
+					<span class="italic">, '</span>&gt;
+					<span class="bold"><strong>, '''&lt;</strong></span>, and 
+					<span class="bold"><strong>&gt;=</strong></span> can compare arbitrary sequences. The result is true if any pair of items from the two sequences has the specified relationship, for example 
+					<span class="italic">$A = $B</span> is true if there is an item in 
+					<span class="italic">$A</span> that is equal to some item in 
+					<span class="italic">$B</span>. 
+				</p><p>The operators 
+					<span class="bold"><strong>is</strong></span> and 
+					<span class="bold"><strong>isnot</strong></span> test whether the operands represent the same (identical) node. For example, 
+					<span class="italic">title
+						<a class="ulink" href="1" target="_top">1</a> is *
+						<a class="ulink" href="@note" target="_top">@note</a>
+						<a class="ulink" href="1" target="_top">1</a>
+					</span> is true if the first title child is the first child element that has a 
+					<span class="italic">@note</span> attribute. If either operand is an empty sequence the result is an empty sequence (which will usually be treated as false). 
+				</p><p>The operators 
+					<span class="bold"><strong>&lt;&lt;</strong></span> and 
+					<span class="bold"><strong>&gt;&gt;</strong></span> test whether one node precedes or follows another in document order. Consider this XML document (XPexample.xml): 
+					&lt;source lang="xml"&gt;
+				</p><div class="literallayout"><p>&lt;book&gt;<br>
+&nbsp;&lt;title&gt;Being&nbsp;a&nbsp;Dog&nbsp;Is&nbsp;a&nbsp;Full-Time&nbsp;Job&lt;/title&gt;<br>
+&nbsp;&lt;author&gt;Charles&nbsp;M.&nbsp;Schulz&lt;/author&gt;<br>
+&nbsp;&lt;character&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;name&gt;Snoopy&lt;/name&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;friend-of&gt;Peppermint&nbsp;Patty&lt;/friend-of&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;since&gt;1950-10-04&lt;/since&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;age&gt;2&lt;/age&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;qualification&gt;extroverted&nbsp;beagle&lt;/qualification&gt;<br>
+&nbsp;&lt;/character&gt;<br>
+&nbsp;&lt;character&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;name&gt;Peppermint&nbsp;Patty&lt;/name&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;since&gt;1966-08-22&gt;/since&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;age&gt;4&lt;/age&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;qualification&gt;bold,&nbsp;brash&nbsp;and&nbsp;tomboyish&lt;/qualification&gt;<br>
+&nbsp;&lt;/character&gt;<br>
+&lt;/book&gt;<br>
+</p></div><p> </p><p>This file conforms to the following Schema (XPexample.xsd):</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><div class="literallayout"><p>&lt;xs:schema&nbsp;xmlns:xs="http://www.w3.org/2001/XMLSchema"<br>
+&nbsp;elementFormDefault="qualified"&gt;<br>
+</p></div><div class="literallayout"><p>&nbsp;&lt;xs:element&nbsp;name="book"&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;xs:complexType&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:sequence&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;ref="title"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;ref="author"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;maxOccurs="unbounded"&nbsp;ref="character"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:sequence&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;/xs:complexType&gt;<br>
+&nbsp;&lt;/xs:element&gt;<br>
+</p></div><div class="literallayout"><p>&nbsp;&lt;xs:element&nbsp;name="title"&nbsp;type="characterName"&gt;&lt;/xs:element&gt;<br>
+</p></div><div class="literallayout"><p>&nbsp;&lt;xs:element&nbsp;name="author"&nbsp;type="characterName"&gt;&lt;/xs:element&gt;<br>
+</p></div><div class="literallayout"><p>&nbsp;&lt;xs:element&nbsp;name="character"&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;xs:complexType&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:sequence&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;ref="name"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;ref="friend-of"&nbsp;minOccurs="0"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;ref="since"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;ref="age"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element&nbsp;ref="qualification"&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:sequence&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;/xs:complexType&gt;<br>
+&nbsp;&lt;/xs:element&gt;<br>
+&nbsp;&lt;xs:element&nbsp;name="name"&nbsp;type="characterName"&nbsp;/&gt;<br>
+&nbsp;&lt;xs:element&nbsp;name="friend-of"&nbsp;type="characterName"&nbsp;/&gt;<br>
+&nbsp;&lt;xs:element&nbsp;name="since"&nbsp;type="xs:date"&nbsp;/&gt;<br>
+&nbsp;&lt;xs:element&nbsp;name="age"&nbsp;type="xs:nonNegativeInteger"&nbsp;/&gt;<br>
+&nbsp;&lt;xs:element&nbsp;name="qualification"&nbsp;type="xs:string"&nbsp;/&gt;<br>
+</p></div><div class="literallayout"><p>&nbsp;&lt;xs:simpleType&nbsp;name="characterName"&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;xs:restriction&nbsp;base="xs:normalizedString"&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:minLength&nbsp;value="1"/&gt;<br>
+&nbsp;&nbsp;&nbsp;&lt;/xs:restriction&gt;<br>
+&nbsp;&lt;/xs:simpleType&gt;<br>
+&lt;/xs:schema&gt;<br>
+</p></div><p> </p><p>
+					<span class="bold"><strong>
+						<span class="italic">Examples:</span>
+					</strong></span> 
+				</p><div class="literallayout"><p>book/character[name="Snoopy"]&nbsp;&amp;lt;&amp;lt;&nbsp;book/character[name="Peppermint&nbsp;Patty"]&nbsp;<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:boolean: true</p></li></ol></div><div class="literallayout"><p>book/character[name="Peppermint&nbsp;Patty"]&nbsp;&amp;lt;&amp;lt;&nbsp;book/character[name="Snoopy"]<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:boolean: false</p></li></ol></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s08.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s08.html
index 788fefc..d822031 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s08.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s08.html
@@ -1,4 +1,5 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Conditional Expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s07.html" title="Comparisons"><link rel="next" href="ch02s03s09.html" title="Quantified Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Conditional_Expressions"></a>Conditional Expressions</h3></div></div></div><p>XPath 2.0 allows a conditional expression of the form <span class="italic">if ( E1 ) then E2 else E3</span>. For example,
-        <span class="italic">if (@discount) then @discount else
-        0</span> returns the value of the discount attribute if it is
-        present, or zero otherwise.</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Conditional Expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s07.html" title="Comparisons"><link rel="next" href="ch02s03s09.html" title="Quantified Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Conditional Expressions"><div class="titlepage"><div><div><h3 class="title"><a name="Conditional_Expressions"></a>Conditional Expressions</h3></div></div></div><p>XPath 2.0 allows a conditional expression of the form 
+					<span class="italic">if ( E1 ) then E2 else E3</span>. For example, 
+					<span class="italic">if (@discount) then @discount else 0</span> returns the value of the discount attribute if it is present, or zero otherwise. 
+				</p><p>
+					 </p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s09.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s09.html
index 4d0e877..85c2ae1 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s09.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s09.html
@@ -1,10 +1,7 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Quantified Expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s08.html" title="Conditional Expressions"><link rel="next" href="ch02s03s10.html" title="And, Or Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Quantified_Expressions"></a>Quantified Expressions</h3></div></div></div><p>The expression <span class="italic">some $x in E1 satisfies
-        E2</span> returns true if there is an item in the sequence E1 for
-        which the effective boolean value of E2 is true. Note that E2 must use
-        the range variable <span class="italic">$x</span> to refer to
-        the item being tested; it does not become the context item. For
-        example, <span class="italic">some $x in @* satisfies $x eq
-        ""</span> is true if the context item is an element that has at
-        least one zero-length attribute value.</p><p>Similarly, the expression <span class="italic">every $x in E1
-        satisfies E2</span> returns true if every item in the sequence
-        given by E1 satisfies the condition.</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Quantified Expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s08.html" title="Conditional Expressions"><link rel="next" href="ch02s03s10.html" title="And, Or Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Quantified Expressions"><div class="titlepage"><div><div><h3 class="title"><a name="Quantified_Expressions"></a>Quantified Expressions</h3></div></div></div><p>The expression 
+					<span class="italic">some $x in E1 satisfies E2</span> returns true if there is an item in the sequence E1 for which the effective boolean value of E2 is true. Note that E2 must use the range variable 
+					<span class="italic">$x</span> to refer to the item being tested; it does not become the context item. For example, 
+					<span class="italic">some $x in @* satisfies $x eq ""</span> is true if the context item is an element that has at least one zero-length attribute value. 
+				</p><p>Similarly, the expression 
+					<span class="italic">every $x in E1 satisfies E2</span> returns true if every item in the sequence given by E1 satisfies the condition. 
+				</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s10.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s10.html
index ce4ff84..da494ce 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s10.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s10.html
@@ -1,5 +1,28 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>And, Or Expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s09.html" title="Quantified Expressions"><link rel="next" href="ch02s03s11.html" title="SequenceType Matching Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="And.2C_Or_Expressions"></a>And, Or Expressions</h3></div></div></div><p>The expression <span class="italic">E1 and E2</span>
-        returns true if the effective boolean values of E1 and E2 are both
-        true. The expression <span class="italic">E1 or E2</span>
-        returns true if the effective boolean values of either or both of E1
-        and E2 are true.</p><p><pre class="programlisting"> (for a truth table) 1 and 1</pre></p><p><span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:boolean: true</p></li></ol></div><p><pre class="programlisting">1 and 0</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:boolean: false</p></li></ol></div><p><pre class="programlisting">1 or 0</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:boolean: true</p></li></ol></div><p><pre class="programlisting">0 or 1</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:boolean: true</p></li></ol></div><p></p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>And, Or Expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s09.html" title="Quantified Expressions"><link rel="next" href="ch02s03s11.html" title="SequenceType Matching Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="And, Or Expressions"><div class="titlepage"><div><div><h3 class="title"><a name="And.2C_Or_Expressions"></a>And, Or Expressions</h3></div></div></div><p>The expression 
+					<span class="italic">E1 and E2</span> returns true if the effective boolean values of E1 and E2 are both true. The expression 
+					<span class="italic">E1 or E2</span> returns true if the effective boolean values of either or both of E1 and E2 are true. 
+				</p><p>
+					<span class="bold"><strong>
+						<span class="italic">Example:</span>
+					</strong></span> (for a truth table) 
+				</p><div class="literallayout"><p>1&nbsp;and&nbsp;1<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:boolean: true</p></li></ol></div><p>
+					 </p><div class="literallayout"><p>1&nbsp;and&nbsp;0<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:boolean: false</p></li></ol></div><p>
+					 </p><div class="literallayout"><p>1&nbsp;or&nbsp;0<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:boolean: true</p></li></ol></div><p>
+					 </p><div class="literallayout"><p>0&nbsp;or&nbsp;1<br>
+</p></div><p> 
+
+					<span class="italic">'result: '</span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:boolean: true</p></li></ol></div><p>
+					 </p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s11.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s11.html
index 9385c68..e2331f5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s11.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch02s03s11.html
@@ -1,23 +1,31 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>SequenceType Matching Expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s10.html" title="And, Or Expressions"><link rel="next" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="SequenceType_Matching_Expressions"></a>SequenceType Matching Expressions</h3></div></div></div><p>The rules for SequenceType matching compare the actual type of a
-        value with an expected type. These rules are a subset of the formal
-        rules that match a value with an expected type defined in XQuery 1.0
-        and XPath 2.0 Formal Semantics <a class="ulink" href="http://www.w3.org/TR/xpath20/#XQueryFormalSemantics" target="_top">http://www.w3.org/TR/xpath20/#XQueryFormalSemantics</a>,
-        because the Formal Semantics must be able to match a value with any
-        XML Schema type, whereas the rules below only match values against
-        those types expressible by the SequenceType syntax.</p><p>Some of the rules for SequenceType matching require determining
-        whether a given type name is the same as or derived from an expected
-        type name. The given type name may be "known" (defined in the in-scope
-        schema definitions), or "unknown" (not defined in the in-scope schema
-        definitions). An unknown type name might be encountered, for example,
-        if a source document has been validated using a schema that was not
-        imported into the static context. In this case, an implementation is
-        allowed (but is not required) to provide an implementation-dependent
-        mechanism for determining whether the unknown type name is derived
-        from the expected type name. For example, an implementation might
-        maintain a data dictionary containing information about type
-        hierarchies. consider the following XML document:</p><pre class="programlisting">&lt;sorbo&gt;
- &lt;is&gt;elite&lt;/is&gt;
- &lt;!-- life sux --&gt;
-&lt;/sorbo&gt;
-</pre><p>Then, the following are some example of SequenceType
-        matchings:</p><p><pre class="programlisting"> element({*})</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>element: sorbo</p></li></ol></div><p><pre class="programlisting">element(elite)</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>Empty results</p></li></ol></div><p><pre class="programlisting">sorbo/comment()</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>comment: life sux</p></li></ol></div><p><pre class="programlisting">data(/sorbo/comment())</pre></p><p> <span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>xs:string: life sux</p></li></ol></div><p><pre class="programlisting">sorbo/node()</pre></p><p><span class="bold"><strong>result:</strong></span></p><div class="orderedlist"><ol type="1"><li><p>text:</p></li><li><p>element: is</p></li><li><p>comment: life sux</p></li><li><p>text:</p></li></ol></div><p></p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>SequenceType Matching Expressions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s10.html" title="And, Or Expressions"><link rel="next" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="SequenceType Matching Expressions"><div class="titlepage"><div><div><h3 class="title"><a name="SequenceType_Matching_Expressions"></a>SequenceType Matching Expressions</h3></div></div></div><p>The rules for SequenceType matching compare the actual type of a value with an expected type. These rules are a subset of the formal rules that match a value with an expected type defined in XQuery 1.0 and XPath 2.0 Formal Semantics 
+					<a class="ulink" href="http://www.w3.org/TR/xpath20/#XQueryFormalSemantics" target="_top">http://www.w3.org/TR/xpath20/#XQueryFormalSemantics</a>, because the Formal Semantics must be able to match a value with any XML Schema type, whereas the rules below only match values against those types expressible by the SequenceType syntax. 
+				</p><p>Some of the rules for SequenceType matching require determining whether a given type name is the same as or derived from an expected type name. The given type name may be "known" (defined in the in-scope schema definitions), or "unknown" (not defined in the in-scope schema definitions). An unknown type name might be encountered, for example, if a source document has been validated using a schema that was not imported into the static context. In this case, an implementation is allowed (but is not required) to provide an implementation-dependent mechanism for determining whether the unknown type name is derived from the expected type name. For example, an implementation might maintain a data dictionary containing information about type hierarchies. consider the following XML document: 
+					&lt;source lang="xml"&gt;&lt;sorbo&gt;</p><div class="literallayout"><p>&nbsp;&lt;is&gt;elite&lt;/is&gt;<br>
+&nbsp;&lt;!--&nbsp;life&nbsp;sux&nbsp;--&gt;<br>
+</p></div><p>&lt;/sorbo&gt;
+					 
+					then, the following are some example of SequenceType matchings: </p><div class="literallayout"><p>element({*})<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>element: sorbo</p></li></ol></div><p>
+					 </p><div class="literallayout"><p>element(elite)<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Empty results</p></li></ol></div><div class="literallayout"><p>&nbsp;sorbo/comment()<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>comment: life sux</p></li></ol></div><div class="literallayout"><p>&nbsp;data(/sorbo/comment())<br>
+</p></div><p> 
+
+					<span class="bold"><strong>result:</strong></span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xs:string: life sux</p></li></ol></div><p>
+					 </p><div class="literallayout"><p>sorbo/node()<br>
+</p></div><p> 
+
+					<span class="italic">'result: '</span> 
+				</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>text: </p></li><li class="listitem"><p>element: is </p></li><li class="listitem"><p>comment: life sux </p></li><li class="listitem"><p>text:</p></li></ol></div><p>
+</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03.html
index 37ac396..9d08054 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03.html
@@ -1,13 +1,5 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>How to use XPath 2.0 functions with PsychoPath</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="prev" href="ch02s03s11.html" title="SequenceType Matching Expressions"><link rel="next" href="ch03s02.html" title="Constructor Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="How_to_use_XPath_2.0_functions_with_PsychoPath"></a>How to use XPath 2.0 functions with PsychoPath</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch03.html#Accessors">Accessors</a></span></li><li><span class="section"><a href="ch03s02.html">Constructor Functions</a></span></li><li><span class="section"><a href="ch03s03.html">Functions on Numeric Values</a></span></li><li><span class="section"><a href="ch03s04.html">Functions to Assemble and Disassemble Strings</a></span></li><li><span class="section"><a href="ch03s05.html">Compare and Other Functions on String Values</a></span></li><li><span class="section"><a href="ch03s06.html">Functions Based on Substring Matching</a></span></li><li><span class="section"><a href="ch03s07.html">String Functions that Use Pattern Matching</a></span></li><li><span class="section"><a href="ch03s08.html">Functions on Boolean Values</a></span></li><li><span class="section"><a href="ch03s09.html">Component Extraction Functions on Durations, Dates and
-      Times</a></span></li><li><span class="section"><a href="ch03s10.html">Functions Related to QNames</a></span></li><li><span class="section"><a href="ch03s11.html">Functions on Nodes</a></span><ul><li><span class="section"><a href="ch03s11.html#General_Functions_on_Sequences">General Functions on Sequences</a></span></li><li><span class="section"><a href="ch03s11s02.html">Functions That Test the Cardinality of Sequences</a></span></li><li><span class="section"><a href="ch03s11s03.html">Deep-Equal, Aggregate Functions, and Functions that Generate
-        Sequences</a></span></li><li><span class="section"><a href="ch03s11s04.html">Context Functions</a></span></li></ul></li></ul></div><p>The aim of this section is to give the user an overview of the
-    available XPath 2.0 functions that are implemented in PsychoPath. For the
-    formal specifications, see the W3C web-site for XPath 2.0 functions and
-    operators <a class="ulink" href="http://www.w3.org/TR/xpath-functions/" target="_top">http://www.w3.org/TR/xpath-functions/</a>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Accessors"></a>Accessors</h2></div></div></div><p>In order for PsychoPath to operate on instances of the XPath 2.0
-      data model, the model must expose the properties of the items it
-      contains. It does this by defining a family of accessor functions. These
-      functions are not available to users or applications to call directly.
-      Instead, they are descriptions of the information that an implementation
-      of the model must expose to applications.</p><p>data(&lsquo;string&rsquo;)</p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XSString)rs.first()).stringvalue();
-println(n);</pre></p><p>In order to get the result of &lsquo;string&rsquo;</p></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>How to use XPath 2.0 functions with PsychoPath</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="index.html" title="usermanual"><link rel="prev" href="ch02s03s11.html" title="SequenceType Matching Expressions"><link rel="next" href="ch03s02.html" title="Constructor Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" title="How to use XPath 2.0 functions with PsychoPath"><div class="titlepage"><div><div><h2 class="title"><a name="How_to_use_XPath_2.0_functions_with_PsychoPath"></a>How to use XPath 2.0 functions with PsychoPath</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch03.html#Accessors">Accessors</a></span></li><li><span class="section"><a href="ch03s02.html">Constructor Functions</a></span></li><li><span class="section"><a href="ch03s03.html">Functions on Numeric Values</a></span></li><li><span class="section"><a href="ch03s04.html">Functions to Assemble and Disassemble Strings</a></span></li><li><span class="section"><a href="ch03s05.html">Compare and Other Functions on String Values</a></span></li><li><span class="section"><a href="ch03s06.html">Functions Based on Substring Matching</a></span></li><li><span class="section"><a href="ch03s07.html">String Functions that Use Pattern Matching</a></span></li><li><span class="section"><a href="ch03s08.html">Functions on Boolean Values</a></span></li><li><span class="section"><a href="ch03s09.html">Component Extraction Functions on Durations, Dates and Times</a></span></li><li><span class="section"><a href="ch03s10.html">Functions Related to QNames</a></span></li><li><span class="section"><a href="ch03s11.html">Functions on Nodes</a></span><ul><li><span class="section"><a href="ch03s11.html#General_Functions_on_Sequences">General Functions on Sequences</a></span></li><li><span class="section"><a href="ch03s11s02.html">Functions That Test the Cardinality of Sequences</a></span></li><li><span class="section"><a href="ch03s11s03.html">Deep-Equal, Aggregate Functions, and Functions that Generate Sequences</a></span></li><li><span class="section"><a href="ch03s11s04.html">Context Functions</a></span></li></ul></li></ul></div><p>The aim of this section is to give the user an overview of the available XPath 2.0 functions that are implemented in PsychoPath. For the formal specifications, see the W3C web-site for XPath 2.0 functions and operators 
+			<a class="ulink" href="http://www.w3.org/TR/xpath-functions/" target="_top">http://www.w3.org/TR/xpath-functions/</a>.
+			 
+		</p><div class="section" title="Accessors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Accessors"></a>Accessors</h2></div></div></div><p>In order for PsychoPath to operate on instances of the XPath 2.0 data model, the model must expose the properties of the items it contains. It does this by defining a family of accessor functions. These functions are not available to users or applications to call directly. Instead, they are descriptions of the information that an implementation of the model must expose to applications. </p><div class="literallayout"><p>data(&lsquo;string&rsquo;)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XSString)rs.first()).stringvalue(); println(n);</p><p>in order to get the result of &lsquo;string&rsquo;</p></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s02.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s02.html
index 04df21f..cb83576 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s02.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s02.html
@@ -1,2 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Constructor Functions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="next" href="ch03s03.html" title="Functions on Numeric Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Constructor_Functions"></a>Constructor Functions</h2></div></div></div><p><pre class="programlisting">xs:dateTime("2002-02-01T10:00:00+06:00")</pre></p><p>From within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XSDateTime)rs.first()).stringvalue(); println(n);</pre></p><p>in order to get the result of &lsquo;2002-02-01T04:00:00Z&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Constructor Functions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="next" href="ch03s03.html" title="Functions on Numeric Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Constructor Functions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Constructor_Functions"></a>Constructor Functions</h2></div></div></div><div class="literallayout"><p>xs:dateTime("2002-02-01T10:00:00+06:00")<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XSDateTime)rs.first()).stringvalue(); println(n);</p><p>in order to get the result of &lsquo;2002-02-01T04:00:00Z&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s03.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s03.html
index c9203ea..54e3290 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s03.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s03.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Functions on Numeric Values</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s02.html" title="Constructor Functions"><link rel="next" href="ch03s04.html" title="Functions to Assemble and Disassemble Strings"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_on_Numeric_Values"></a>Functions on Numeric Values</h2></div></div></div><p><pre class="programlisting">ceiling(xs:float(&lsquo;10.4&rsquo;))</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">float n = ((XSFloat)rs.first()).floatvalue();
-println(n);</pre></p><p>In order to get the result of &lsquo;11.0&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Functions on Numeric Values</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s02.html" title="Constructor Functions"><link rel="next" href="ch03s04.html" title="Functions to Assemble and Disassemble Strings"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Functions on Numeric Values"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_on_Numeric_Values"></a>Functions on Numeric Values</h2></div></div></div><div class="literallayout"><p>ceiling(xs:float(&lsquo;10.4&rsquo;))<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>float n = ((XSFloat)rs.first()).floatvalue(); println(n);</p><p>in order to get the result of &lsquo;11.0&rsquo; </p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s04.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s04.html
index 7cef82c..1892e2e 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s04.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s04.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Functions to Assemble and Disassemble Strings</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s03.html" title="Functions on Numeric Values"><link rel="next" href="ch03s05.html" title="Compare and Other Functions on String Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_to_Assemble_and_Disassemble_Strings"></a>Functions to Assemble and Disassemble Strings</h2></div></div></div><p><pre class="programlisting">codepoints-to-string(0111)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XSString)rs.first()).stringvalue();
-println(n);&lt;/source&gt;</pre></p><p>In order to get the result of &lsquo;o&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Functions to Assemble and Disassemble Strings</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s03.html" title="Functions on Numeric Values"><link rel="next" href="ch03s05.html" title="Compare and Other Functions on String Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Functions to Assemble and Disassemble Strings"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_to_Assemble_and_Disassemble_Strings"></a>Functions to Assemble and Disassemble Strings</h2></div></div></div><div class="literallayout"><p>codepoints-to-string(0111)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XSString)rs.first()).stringvalue(); println(n);</p><p>in order to get the result of &lsquo;o&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s05.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s05.html
index 8c54f5c..0c996c9 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s05.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s05.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Compare and Other Functions on String Values</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s04.html" title="Functions to Assemble and Disassemble Strings"><link rel="next" href="ch03s06.html" title="Functions Based on Substring Matching"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Compare_and_Other_Functions_on_String_Values"></a>Compare and Other Functions on String Values</h2></div></div></div><p><pre class="programlisting">concat(&lsquo;un&rsquo;, &lsquo;grateful&rsquo;)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XSString)rs.first()).stringvalue();
-println(n);</pre></p><p>In order to get the result of &lsquo;ungrateful&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Compare and Other Functions on String Values</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s04.html" title="Functions to Assemble and Disassemble Strings"><link rel="next" href="ch03s06.html" title="Functions Based on Substring Matching"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Compare and Other Functions on String Values"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Compare_and_Other_Functions_on_String_Values"></a>Compare and Other Functions on String Values</h2></div></div></div><div class="literallayout"><p>concat(&lsquo;un&rsquo;,&nbsp;&lsquo;grateful&rsquo;)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XSString)rs.first()).stringvalue(); println(n);</p><p>in order to get the result of &lsquo;ungrateful&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s06.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s06.html
index f609e13..04322fd 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s06.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s06.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Functions Based on Substring Matching</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s05.html" title="Compare and Other Functions on String Values"><link rel="next" href="ch03s07.html" title="String Functions that Use Pattern Matching"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_Based_on_Substring_Matching"></a>Functions Based on Substring Matching</h2></div></div></div><p><pre class="programlisting">contains("abc", "edf")</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">boolean n = ((XSBoolean)rs.first()).value();
-println(n);</pre></p><p>In order to get the result of &lsquo;false&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Functions Based on Substring Matching</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s05.html" title="Compare and Other Functions on String Values"><link rel="next" href="ch03s07.html" title="String Functions that Use Pattern Matching"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Functions Based on Substring Matching"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_Based_on_Substring_Matching"></a>Functions Based on Substring Matching</h2></div></div></div><div class="literallayout"><p>contains("abc",&nbsp;"edf")<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>boolean n = ((XSBoolean)rs.first()).value(); println(n);</p><p>in order to get the result of &lsquo;false&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s07.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s07.html
index ee2acc6..0a1ec2c 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s07.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s07.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>String Functions that Use Pattern Matching</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s06.html" title="Functions Based on Substring Matching"><link rel="next" href="ch03s08.html" title="Functions on Boolean Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="String_Functions_that_Use_Pattern_Matching"></a>String Functions that Use Pattern Matching</h2></div></div></div><p><pre class="programlisting">matches(&lsquo;abcd&rsquo;, &lsquo;abcd&rsquo;)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">boolean n = ((XSBoolean)rs.first()).value();
-println(n);</pre></p><p>In order to get the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>String Functions that Use Pattern Matching</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s06.html" title="Functions Based on Substring Matching"><link rel="next" href="ch03s08.html" title="Functions on Boolean Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="String Functions that Use Pattern Matching"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="String_Functions_that_Use_Pattern_Matching"></a>String Functions that Use Pattern Matching</h2></div></div></div><div class="literallayout"><p>matches(&lsquo;abcd&rsquo;,&nbsp;&lsquo;abcd&rsquo;)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>boolean n = ((XSBoolean)rs.first()).value(); println(n);</p><p>in order to get the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s08.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s08.html
index 18ee268..68300bf 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s08.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s08.html
@@ -1,3 +1,5 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Functions on Boolean Values</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s07.html" title="String Functions that Use Pattern Matching"><link rel="next" href="ch03s09.html" title="Component Extraction Functions on Durations, Dates and Times"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_on_Boolean_Values"></a>Functions on Boolean Values</h2></div></div></div><p><pre class="programlisting">not(true())</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">boolean n = ((XSBoolean)rs.first()).value();
-println(n);</pre></p><p>in order to get the result of &lsquo;false&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Functions on Boolean Values</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s07.html" title="String Functions that Use Pattern Matching"><link rel="next" href="ch03s09.html" title="Component Extraction Functions on Durations, Dates and Times"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Functions on Boolean Values"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_on_Boolean_Values"></a>Functions on Boolean Values</h2></div></div></div><div class="literallayout"><p>not(true())<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>
+				boolean n = ((XSBoolean)rs.first()).value();
+				println(n);
+				</p><p>in order to get the result of &lsquo;false&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s09.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s09.html
index ac64dd5..3ee95ef 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s09.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s09.html
@@ -1,4 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Component Extraction Functions on Durations, Dates and Times</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s08.html" title="Functions on Boolean Values"><link rel="next" href="ch03s10.html" title="Functions Related to QNames"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Component_Extraction_Functions_on_Durations.2C_Dates_and_Times"></a>Component Extraction Functions on Durations, Dates and
-      Times</h2></div></div></div><p><pre class="programlisting">timezone-from-time(xs:time("13:20:00+05:00"))</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); 
-println(n);</pre></p><p>in order to get the result of &lsquo;PT5H&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Component Extraction Functions on Durations, Dates and Times</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s08.html" title="Functions on Boolean Values"><link rel="next" href="ch03s10.html" title="Functions Related to QNames"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Component Extraction Functions on Durations, Dates and Times"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Component_Extraction_Functions_on_Durations.2C_Dates_and_Times"></a>Component Extraction Functions on Durations, Dates and Times</h2></div></div></div><div class="literallayout"><p>timezone-from-time(xs:time("13:20:00+05:00"))<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); println(n);</p><p>in order to get the result of &lsquo;PT5H&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s10.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s10.html
index 41d2e40..3333ac2 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s10.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s10.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Functions Related to QNames</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s09.html" title="Component Extraction Functions on Durations, Dates and Times"><link rel="next" href="ch03s11.html" title="Functions on Nodes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_Related_to_QNames"></a>Functions Related to QNames</h2></div></div></div><p><pre class="programlisting">local-name-from-QName(QName(&lsquo; <a class="ulink" href="http://www.example.com/example" target="_top">http://www.example.com/example</a>&rsquo;, &lsquo;person&rsquo;))</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XSNCName)rs.first()).stringvalue();
-println(n);</pre></p><p>in order to get the result of &lsquo;person&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Functions Related to QNames</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s09.html" title="Component Extraction Functions on Durations, Dates and Times"><link rel="next" href="ch03s11.html" title="Functions on Nodes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Functions Related to QNames"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_Related_to_QNames"></a>Functions Related to QNames</h2></div></div></div><div class="literallayout"><p>local-name-from-QName(QName(&lsquo;http://www.example.com/example&rsquo;,&nbsp;&lsquo;person&rsquo;))<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XSNCName)rs.first()).stringvalue(); println(n); </p><p>in order to get the result of &lsquo;person&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11.html
index 458c7b1..77c4ccd 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11.html
@@ -1,7 +1,8 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Functions on Nodes</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s10.html" title="Functions Related to QNames"><link rel="next" href="ch03s11s02.html" title="Functions That Test the Cardinality of Sequences"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_on_Nodes"></a>Functions on Nodes</h2></div></div></div><p></p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="General_Functions_on_Sequences"></a>General Functions on Sequences</h3></div></div></div><p><pre class="programlisting">remove((&lsquo;s&rsquo;,&lsquo;o&rsquo;,&lsquo;m&rsquo;,&lsquo;e&rsquo;,&lsquo;t&rsquo;,&lsquo;h&rsquo;,&lsquo;i&rsquo;,&lsquo;n&rsquo;,&lsquo;g&rsquo;), 6)</pre></p><p>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</p><pre class="programlisting">for (Iterator iter = rs.iterator(); iter.hasNext();) {
-  Object item = iter.next(); 
-  String n = ((XSString)item).stringvalue();
-  print(n + " ");
-} println("");
-</pre><p>in order to get the result of &lsquo;s o m e t i n g&rsquo;</p></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Functions on Nodes</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03.html" title="How to use XPath 2.0 functions with PsychoPath"><link rel="prev" href="ch03s10.html" title="Functions Related to QNames"><link rel="next" href="ch03s11s02.html" title="Functions That Test the Cardinality of Sequences"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Functions on Nodes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Functions_on_Nodes"></a>Functions on Nodes</h2></div></div></div><div class="section" title="General Functions on Sequences"><div class="titlepage"><div><div><h3 class="title"><a name="General_Functions_on_Sequences"></a>General Functions on Sequences</h3></div></div></div><div class="literallayout"><p>remove((&lsquo;s&rsquo;,&lsquo;o&rsquo;,&lsquo;m&rsquo;,&lsquo;e&rsquo;,&lsquo;t&rsquo;,&lsquo;h&rsquo;,&lsquo;i&rsquo;,&lsquo;n&rsquo;,&lsquo;g&rsquo;),&nbsp;6)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>
+					for (Iterator iter = rs.iterator(); iter.hasNext();) {</p><div class="literallayout"><p>&nbsp;&nbsp;Object&nbsp;item&nbsp;=&nbsp;iter.next();&nbsp;<br>
+&nbsp;&nbsp;String&nbsp;n&nbsp;=&nbsp;((XSString)item).stringvalue();<br>
+&nbsp;&nbsp;print(n&nbsp;+&nbsp;"&nbsp;");<br>
+</p></div><p>}
+					println(""); 
+					</p><p>in order to get the result of &lsquo;s o m e t i n g&rsquo;</p></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s02.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s02.html
index 2fa440a..c77c4d6 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s02.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s02.html
@@ -1,7 +1,8 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Functions That Test the Cardinality of Sequences</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03s11.html" title="Functions on Nodes"><link rel="prev" href="ch03s11.html" title="Functions on Nodes"><link rel="next" href="ch03s11s03.html" title="Deep-Equal, Aggregate Functions, and Functions that Generate Sequences"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Functions_That_Test_the_Cardinality_of_Sequences"></a>Functions That Test the Cardinality of Sequences</h3></div></div></div><p><pre class="programlisting">one-or-more((1,2,3,4,5))</pre></p><p>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</p><pre class="programlisting">for (Iterator iter = rs.iterator(); iter.hasNext();) {
- Object item = iter.next();
- int n = ((XSInteger)item).intvalue();
- print(n + " ");
-} println("");
-</pre><p>in order to get the result of &lsquo;1 2 3 4 5&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Functions That Test the Cardinality of Sequences</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03s11.html" title="Functions on Nodes"><link rel="prev" href="ch03s11.html" title="Functions on Nodes"><link rel="next" href="ch03s11s03.html" title="Deep-Equal, Aggregate Functions, and Functions that Generate Sequences"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Functions That Test the Cardinality of Sequences"><div class="titlepage"><div><div><h3 class="title"><a name="Functions_That_Test_the_Cardinality_of_Sequences"></a>Functions That Test the Cardinality of Sequences</h3></div></div></div><div class="literallayout"><p>one-or-more((1,2,3,4,5))<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>
+					for (Iterator iter = rs.iterator(); iter.hasNext();) {</p><div class="literallayout"><p>&nbsp;Object&nbsp;item&nbsp;=&nbsp;iter.next();<br>
+&nbsp;int&nbsp;n&nbsp;=&nbsp;((XSInteger)item).intvalue();<br>
+&nbsp;print(n&nbsp;+&nbsp;"&nbsp;");<br>
+</p></div><p>}
+					println(""); 
+					</p><p>in order to get the result of &lsquo;1 2 3 4 5&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s03.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s03.html
index e8734e0..059d327 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s03.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s03.html
@@ -1,4 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Deep-Equal, Aggregate Functions, and Functions that Generate Sequences</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03s11.html" title="Functions on Nodes"><link rel="prev" href="ch03s11s02.html" title="Functions That Test the Cardinality of Sequences"><link rel="next" href="ch03s11s04.html" title="Context Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Deep-Equal.2C_Aggregate_Functions.2C_and_Functions_that_Generate_Sequences"></a>Deep-Equal, Aggregate Functions, and Functions that Generate
-        Sequences</h3></div></div></div><p><pre class="programlisting">avg((3,4,5))</pre></p><p>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</p><p><pre class="programlisting">double avg = ((XSDouble)rs.first()).doublevalue();
-println(avg);</pre></p><p>in order to get the result of &lsquo;4.0&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Deep-Equal, Aggregate Functions, and Functions that Generate Sequences</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03s11.html" title="Functions on Nodes"><link rel="prev" href="ch03s11s02.html" title="Functions That Test the Cardinality of Sequences"><link rel="next" href="ch03s11s04.html" title="Context Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Deep-Equal, Aggregate Functions, and Functions that Generate Sequences"><div class="titlepage"><div><div><h3 class="title"><a name="Deep-Equal.2C_Aggregate_Functions.2C_and_Functions_that_Generate_Sequences"></a>Deep-Equal, Aggregate Functions, and Functions that Generate Sequences</h3></div></div></div><div class="literallayout"><p>avg((3,4,5))<br>
+</p></div><p> </p><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>double avg = ((XSDouble)rs.first()).doublevalue(); println(avg); </p><p>in order to get the result of &lsquo;4.0&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s04.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s04.html
index 1b243d6..d395098 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s04.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch03s11s04.html
@@ -1,2 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Context Functions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch03s11.html" title="Functions on Nodes"><link rel="prev" href="ch03s11s03.html" title="Deep-Equal, Aggregate Functions, and Functions that Generate Sequences"><link rel="next" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Context_Functions"></a>Context Functions</h3></div></div></div><p><pre class="programlisting">(10 to 20) = 2</pre></p><p>from within a Java application, in order to extract the result
-        from the result sequence, one would have to use this code:</p><p><pre class="programlisting">int pos = ((XSInteger)rs.first()).intvalue(); println(pos);</pre></p><p>in order to get the result of &lsquo;11&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Context Functions</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch03s11.html" title="Functions on Nodes"><link rel="prev" href="ch03s11s03.html" title="Deep-Equal, Aggregate Functions, and Functions that Generate Sequences"><link rel="next" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Context Functions"><div class="titlepage"><div><div><h3 class="title"><a name="Context_Functions"></a>Context Functions</h3></div></div></div><div class="literallayout"><p>(10&nbsp;to&nbsp;20)[position()&nbsp;=&nbsp;2]<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>int pos = ((XSInteger)rs.first()).intvalue(); println(pos);</p><p>in order to get the result of &lsquo;11&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04.html
index 789f613..9c471b4 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04.html
@@ -1,6 +1,5 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>How to use XPath 2.0 operators with PsychoPath</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="prev" href="ch03s11s04.html" title="Context Functions"><link rel="next" href="ch04s02.html" title="Comparison of Numeric Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="How_to_use_XPath_2.0_operators_with_PsychoPath"></a>How to use XPath 2.0 operators with PsychoPath</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch04.html#Operators_on_Numeric_Values">Operators on Numeric Values</a></span></li><li><span class="section"><a href="ch04s02.html">Comparison of Numeric Values</a></span></li><li><span class="section"><a href="ch04s03.html">Operators on Boolean Values</a></span></li><li><span class="section"><a href="ch04s04.html">Comparisons of Duration, Date and Time Values</a></span></li><li><span class="section"><a href="ch04s05.html">Arithmetic Functions on Durations</a></span></li><li><span class="section"><a href="ch04s06.html">Arithmetic Functions Dates and Times</a></span></li><li><span class="section"><a href="ch04s07.html">Operators Related to QNames And Nodes</a></span></li><li><span class="section"><a href="ch04s08.html">Union, Intersection and Except</a></span></li><li><span class="section"><a href="ch04s09.html">Operators that Generate Sequences</a></span></li></ul></div><p>The aim of this section is to give the user an overview of the
-    available XPath 2.0 operators that are implemented in PsychoPath. For the
-    formal specifications, see the W3C web-site for XPath 2.0 functions and
-    operators <a class="ulink" href="http://www.w3.org/TR/xpath-functions/" target="_top">http://www.w3.org/TR/xpath-functions/</a>.</p><p></p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_on_Numeric_Values"></a>Operators on Numeric Values</h2></div></div></div><p><pre class="programlisting">xs:integer(4) + xs:integer(3)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">Integer n = ((XSInteger)rs.first()).integervalue(); 
-println(n);</pre></p><p>in order to get the result of &lsquo;7&rsquo;</p></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>How to use XPath 2.0 operators with PsychoPath</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="index.html" title="usermanual"><link rel="prev" href="ch03s11s04.html" title="Context Functions"><link rel="next" href="ch04s02.html" title="Comparison of Numeric Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" title="How to use XPath 2.0 operators with PsychoPath"><div class="titlepage"><div><div><h2 class="title"><a name="How_to_use_XPath_2.0_operators_with_PsychoPath"></a>How to use XPath 2.0 operators with PsychoPath</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="ch04.html#Operators_on_Numeric_Values">Operators on Numeric Values</a></span></li><li><span class="section"><a href="ch04s02.html">Comparison of Numeric Values</a></span></li><li><span class="section"><a href="ch04s03.html">Operators on Boolean Values</a></span></li><li><span class="section"><a href="ch04s04.html">Comparisons of Duration, Date and Time Values</a></span></li><li><span class="section"><a href="ch04s05.html">Arithmetic Functions on Durations</a></span></li><li><span class="section"><a href="ch04s06.html">Arithmetic Functions Dates and Times</a></span></li><li><span class="section"><a href="ch04s07.html">Operators Related to QNames And Nodes</a></span></li><li><span class="section"><a href="ch04s08.html">Union, Intersection and Except</a></span></li><li><span class="section"><a href="ch04s09.html">Operators that Generate Sequences</a></span></li></ul></div><p>The aim of this section is to give the user an overview of the available XPath 2.0 operators that are implemented in PsychoPath. For the formal specifications, see the W3C web-site for XPath 2.0 functions and operators 
+			<a class="ulink" href="http://www.w3.org/TR/xpath-functions/" target="_top">http://www.w3.org/TR/xpath-functions/</a>. 
+		</p><p>
+			 </p><div class="section" title="Operators on Numeric Values"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_on_Numeric_Values"></a>Operators on Numeric Values</h2></div></div></div><div class="literallayout"><p>xs:integer(4)&nbsp;+&nbsp;xs:integer(3)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>Integer n = ((XSInteger)rs.first()).integervalue(); println(n);</p><p>in order to get the result of &lsquo;7&rsquo;</p></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s02.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s02.html
index c2d40a5..845b269 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s02.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s02.html
@@ -1,2 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Comparison of Numeric Values</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="next" href="ch04s03.html" title="Operators on Boolean Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Comparison_of_Numeric_Values"></a>Comparison of Numeric Values</h2></div></div></div><p><pre class="programlisting">xs:decimal(3.3) = xs:decimal(6.6)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">boolean n = ((XSBoolean)rs.first()).value(); println(n);</pre></p><p>in order to get the result of &lsquo;false&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Comparison of Numeric Values</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="next" href="ch04s03.html" title="Operators on Boolean Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Comparison of Numeric Values"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Comparison_of_Numeric_Values"></a>Comparison of Numeric Values</h2></div></div></div><div class="literallayout"><p>xs:decimal(3.3)&nbsp;=&nbsp;xs:decimal(6.6)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>boolean n = ((XSBoolean)rs.first()).value(); println(n);</p><p>in order to get the result of &lsquo;false&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s03.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s03.html
index 8f02b1e..d6ede41 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s03.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s03.html
@@ -1,2 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Operators on Boolean Values</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s02.html" title="Comparison of Numeric Values"><link rel="next" href="ch04s04.html" title="Comparisons of Duration, Date and Time Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_on_Boolean_Values"></a>Operators on Boolean Values</h2></div></div></div><p><pre class="programlisting">xs:boolean(&rsquo;true&rsquo;) gt xs:boolean(&rsquo;false&rsquo;)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">boolean n = ((XSBoolean)rs.first()).value(); println(n);</pre></p><p>in order to get the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Operators on Boolean Values</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s02.html" title="Comparison of Numeric Values"><link rel="next" href="ch04s04.html" title="Comparisons of Duration, Date and Time Values"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Operators on Boolean Values"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_on_Boolean_Values"></a>Operators on Boolean Values</h2></div></div></div><div class="literallayout"><p>xs:boolean(&rsquo;true&rsquo;)&nbsp;gt&nbsp;xs:boolean(&rsquo;false&rsquo;)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>boolean n = ((XSBoolean)rs.first()).value(); println(n); </p><p>in order to get the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s04.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s04.html
index 5ecc9c5..bdc75cc 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s04.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s04.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Comparisons of Duration, Date and Time Values</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s03.html" title="Operators on Boolean Values"><link rel="next" href="ch04s05.html" title="Arithmetic Functions on Durations"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Comparisons_of_Duration.2C_Date_and_Time_Values"></a>Comparisons of Duration, Date and Time Values</h2></div></div></div><p><pre class="programlisting">xs:time("23:00:00+06:00") lt xs:time("12:00:00-06:00")</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">boolean n = ((XSBoolean)rs.first()).value(); 
-println(n);</pre></p><p>in order to get the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Comparisons of Duration, Date and Time Values</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s03.html" title="Operators on Boolean Values"><link rel="next" href="ch04s05.html" title="Arithmetic Functions on Durations"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Comparisons of Duration, Date and Time Values"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Comparisons_of_Duration.2C_Date_and_Time_Values"></a>Comparisons of Duration, Date and Time Values</h2></div></div></div><div class="literallayout"><p>xs:time("23:00:00+06:00")&nbsp;lt&nbsp;xs:time("12:00:00-06:00")<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>boolean n = ((XSBoolean)rs.first()).value(); println(n);</p><p>in order to get the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s05.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s05.html
index 611b868..64fc1bd 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s05.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s05.html
@@ -1,4 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Arithmetic Functions on Durations</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s04.html" title="Comparisons of Duration, Date and Time Values"><link rel="next" href="ch04s06.html" title="Arithmetic Functions Dates and Times"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Arithmetic_Functions_on_Durations"></a>Arithmetic Functions on Durations</h2></div></div></div><p><pre class="programlisting">multiply-dayTimeDuration(xs:dayTimeDuration("PT2H10M"), 2.1)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); 
-println(n);</pre></p><p>which returns a xdt:dayTimeDuration value corresponding to 4 hours
-      and 33 minutes &lsquo;PT4H33M&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Arithmetic Functions on Durations</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s04.html" title="Comparisons of Duration, Date and Time Values"><link rel="next" href="ch04s06.html" title="Arithmetic Functions Dates and Times"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Arithmetic Functions on Durations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Arithmetic_Functions_on_Durations"></a>Arithmetic Functions on Durations</h2></div></div></div><div class="literallayout"><p>multiply-dayTimeDuration(xdt:dayTimeDuration("PT2H10M"),&nbsp;2.1)<br>
+</p></div><p> </p><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XDTDayTimeDuration)rs.first()).stringvalue(); println(n);</p><p>which returns a xdt:dayTimeDuration value corresponding to 4 hours and 33 minutes &lsquo;PT4H33M&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s06.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s06.html
index 41722ea..3680045 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s06.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s06.html
@@ -1,4 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Arithmetic Functions Dates and Times</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s05.html" title="Arithmetic Functions on Durations"><link rel="next" href="ch04s07.html" title="Operators Related to QNames And Nodes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Arithmetic_Functions_Dates_and_Times"></a>Arithmetic Functions Dates and Times</h2></div></div></div><p><pre class="programlisting">add-yearMonthDuration-to-dateTime( xs:dateTime("2000-10-30T11:12:00"), xdt:yearMonthDuration("P1Y2M"))</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XSDateTime)rs.first()).stringvalue(); 
-println(n);</pre></p><p>which returns an xs:dateTime value corresponding to the lexical
-      representation &lsquo;2001-12-30T11:12:00&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Arithmetic Functions Dates and Times</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s05.html" title="Arithmetic Functions on Durations"><link rel="next" href="ch04s07.html" title="Operators Related to QNames And Nodes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Arithmetic Functions Dates and Times"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Arithmetic_Functions_Dates_and_Times"></a>Arithmetic Functions Dates and Times</h2></div></div></div><div class="literallayout"><p>add-yearMonthDuration-to-dateTime(&nbsp;xs:dateTime("2000-10-30T11:12:00"),&nbsp;xdt:yearMonthDuration("P1Y2M"))<br>
+</p></div><p> </p><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>String n = ((XSDateTime)rs.first()).stringvalue(); println(n);</p><p>which returns an xs:dateTime value corresponding to the lexical representation &lsquo;2001-12-30T11:12:00&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s07.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s07.html
index 0d7d838..884e5ff 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s07.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s07.html
@@ -1,3 +1,2 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Operators Related to QNames And Nodes</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s06.html" title="Arithmetic Functions Dates and Times"><link rel="next" href="ch04s08.html" title="Union, Intersection and Except"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_Related_to_QNames_And_Nodes"></a>Operators Related to QNames And Nodes</h2></div></div></div><p><pre class="programlisting">xs:QName(&rsquo;ao&rsquo;) eq xs:QName(&rsquo;ao&rsquo;)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">boolean n = ((XSBoolean)rs.first()).value(); 
-println(n);</pre></p><p>which returns the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Operators Related to QNames And Nodes</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s06.html" title="Arithmetic Functions Dates and Times"><link rel="next" href="ch04s08.html" title="Union, Intersection and Except"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Operators Related to QNames And Nodes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_Related_to_QNames_And_Nodes"></a>Operators Related to QNames And Nodes</h2></div></div></div><div class="literallayout"><p>xs:QName(&rsquo;ao&rsquo;)&nbsp;eq&nbsp;xs:QName(&rsquo;ao&rsquo;)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>boolean n = ((XSBoolean)rs.first()).value(); println(n);</p><p>which returns the result of &lsquo;true&rsquo;</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s08.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s08.html
index 9b4a308..67a6732 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s08.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s08.html
@@ -1,9 +1,9 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Union, Intersection and Except</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s07.html" title="Operators Related to QNames And Nodes"><link rel="next" href="ch04s09.html" title="Operators that Generate Sequences"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Union.2C_Intersection_and_Except"></a>Union, Intersection and Except</h2></div></div></div><p><pre class="programlisting">union($seq2, $seq3)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><pre class="programlisting">for (Iterator iter = rs.iterator(); iter.hasNext();) {
-  Object item = iter.next();
-  String n = ((XSString)item).stringvalue();
-  print(n + ", ");
-}
-println("");
-</pre><p> </p><p>which returns the sequence consisting of $item1, $item2,
-      $item3.</p><p></p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Union, Intersection and Except</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s07.html" title="Operators Related to QNames And Nodes"><link rel="next" href="ch04s09.html" title="Operators that Generate Sequences"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Union, Intersection and Except"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Union.2C_Intersection_and_Except"></a>Union, Intersection and Except</h2></div></div></div><div class="literallayout"><p>union($seq2,&nbsp;$seq3)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>
+				for (Iterator iter = rs.iterator(); iter.hasNext();) {</p><div class="literallayout"><p>Object&nbsp;item&nbsp;=&nbsp;iter.next();<br>
+String&nbsp;n&nbsp;=&nbsp;((XSString)item).stringvalue();<br>
+print(n&nbsp;+&nbsp;",&nbsp;");<br>
+</p></div><p>}
+				println(""); 
+				</p><p>which returns the sequence consisting of $item1, $item2, $item3. </p><p>
+</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s09.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s09.html
index d822a00..4ed7fb6 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s09.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/ch04s09.html
@@ -1,3 +1,4 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Operators that Generate Sequences</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s08.html" title="Union, Intersection and Except"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_that_Generate_Sequences"></a>Operators that Generate Sequences</h2></div></div></div><p><pre class="programlisting">(1 to 3)</pre></p><p>from within a Java application, in order to extract the result
-      from the result sequence, one would have to use this code:</p><p><pre class="programlisting">int n = (XSInteger)rs.first()).stringvalue(); 
-println(n);</pre></p><p>which returns the sequence consisting of 1, 2, 3.</p></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Operators that Generate Sequences</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s08.html" title="Union, Intersection and Except"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="Operators that Generate Sequences"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Operators_that_Generate_Sequences"></a>Operators that Generate Sequences</h2></div></div></div><div class="literallayout"><p>(1&nbsp;to&nbsp;3)<br>
+</p></div><p>from within a Java application, in order to extract the result from the result sequence, one would have to use this code: </p><p>int n = (XSInteger)rs.first()).stringvalue(); println(n);</p><p>which returns the sequence consisting of 1, 2, 3. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p></p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p></p><div class="itemizedlist"><ul class="itemizedlist" type="square"><li class="listitem"><p>-</p></li></ul></div></li></ul></div></li></ul></div><p>
+				<a class="ulink" href="/wiki/Category:Draft_Documentation" target="_top">Category:Draft_Documentation</a>
+			</p></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/index.html b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/index.html
index 3a1c190..012e55e 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/index.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/html/index.html
@@ -1,3 +1 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>XPath 2.0 Processor User Manual</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="next" href="ch01.html" title="Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="N10001"></a>XPath 2.0 Processor User Manual</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="chapter"><a href="ch01.html">Introduction</a></span><ul><li><span class="section"><a href="ch01.html#Getting_PsychoPath">Getting PsychoPath</a></span></li></ul></li><li><span class="chapter"><a href="ch02.html">Using PsychoPath XPath 2.0 API</a></span><ul><li><span class="section"><a href="ch02.html#Non-Schema_Aware">Non-Schema Aware</a></span></li><li><span class="section"><a href="ch02s02.html">Schema Aware</a></span></li><li><span class="section"><a href="ch02s03.html">How to use the XPath 2.0 grammar with PsychoPath</a></span><ul><li><span class="section"><a href="ch02s03.html#Constants">Constants</a></span></li><li><span class="section"><a href="ch02s03s02.html">Path expressions</a></span></li><li><span class="section"><a href="ch02s03s03.html">Axis steps</a></span></li><li><span class="section"><a href="ch02s03s04.html">Set difference, intersection and Union</a></span></li><li><span class="section"><a href="ch02s03s05.html">Arithmetic Expressions</a></span><ul><li><span class="section"><a href="ch02s03s05.html#Unary">Unary</a></span></li><li><span class="section"><a href="ch02s03s05s02.html">Multiplication and Division:</a></span></li><li><span class="section"><a href="ch02s03s05s03.html">Addition and Subtraction:</a></span></li></ul></li><li><span class="section"><a href="ch02s03s06.html">Range expressions</a></span></li><li><span class="section"><a href="ch02s03s07.html">Comparisons</a></span></li><li><span class="section"><a href="ch02s03s08.html">Conditional Expressions</a></span></li><li><span class="section"><a href="ch02s03s09.html">Quantified Expressions</a></span></li><li><span class="section"><a href="ch02s03s10.html">And, Or Expressions</a></span></li><li><span class="section"><a href="ch02s03s11.html">SequenceType Matching Expressions</a></span></li></ul></li></ul></li><li><span class="chapter"><a href="ch03.html">How to use XPath 2.0 functions with PsychoPath</a></span><ul><li><span class="section"><a href="ch03.html#Accessors">Accessors</a></span></li><li><span class="section"><a href="ch03s02.html">Constructor Functions</a></span></li><li><span class="section"><a href="ch03s03.html">Functions on Numeric Values</a></span></li><li><span class="section"><a href="ch03s04.html">Functions to Assemble and Disassemble Strings</a></span></li><li><span class="section"><a href="ch03s05.html">Compare and Other Functions on String Values</a></span></li><li><span class="section"><a href="ch03s06.html">Functions Based on Substring Matching</a></span></li><li><span class="section"><a href="ch03s07.html">String Functions that Use Pattern Matching</a></span></li><li><span class="section"><a href="ch03s08.html">Functions on Boolean Values</a></span></li><li><span class="section"><a href="ch03s09.html">Component Extraction Functions on Durations, Dates and
-      Times</a></span></li><li><span class="section"><a href="ch03s10.html">Functions Related to QNames</a></span></li><li><span class="section"><a href="ch03s11.html">Functions on Nodes</a></span><ul><li><span class="section"><a href="ch03s11.html#General_Functions_on_Sequences">General Functions on Sequences</a></span></li><li><span class="section"><a href="ch03s11s02.html">Functions That Test the Cardinality of Sequences</a></span></li><li><span class="section"><a href="ch03s11s03.html">Deep-Equal, Aggregate Functions, and Functions that Generate
-        Sequences</a></span></li><li><span class="section"><a href="ch03s11s04.html">Context Functions</a></span></li></ul></li></ul></li><li><span class="chapter"><a href="ch04.html">How to use XPath 2.0 operators with PsychoPath</a></span><ul><li><span class="section"><a href="ch04.html#Operators_on_Numeric_Values">Operators on Numeric Values</a></span></li><li><span class="section"><a href="ch04s02.html">Comparison of Numeric Values</a></span></li><li><span class="section"><a href="ch04s03.html">Operators on Boolean Values</a></span></li><li><span class="section"><a href="ch04s04.html">Comparisons of Duration, Date and Time Values</a></span></li><li><span class="section"><a href="ch04s05.html">Arithmetic Functions on Durations</a></span></li><li><span class="section"><a href="ch04s06.html">Arithmetic Functions Dates and Times</a></span></li><li><span class="section"><a href="ch04s07.html">Operators Related to QNames And Nodes</a></span></li><li><span class="section"><a href="ch04s08.html">Union, Intersection and Except</a></span></li><li><span class="section"><a href="ch04s09.html">Operators that Generate Sequences</a></span></li></ul></li></ul></div></div></body></html>
\ No newline at end of file
+<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>usermanual</title><link href="book.css" type="text/css" rel="stylesheet"><link href="book.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="usermanual"><link rel="next" href="ch01.html" title="Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="usermanual"><div class="titlepage"><div><div><h1 class="title"><a name="N10001"></a>usermanual</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="chapter"><a href="ch01.html">Introduction</a></span><ul><li><span class="section"><a href="ch01.html#Getting_PsychoPath">Getting PsychoPath</a></span></li></ul></li><li><span class="chapter"><a href="ch02.html">How to feed Psychopath XPath expressions</a></span><ul><li><span class="section"><a href="ch02.html#Non-Schema_Aware">Non-Schema Aware</a></span></li><li><span class="section"><a href="ch02s02.html">Schema Aware</a></span></li><li><span class="section"><a href="ch02s03.html">How to use the XPath 2.0 grammar with PsychoPath</a></span><ul><li><span class="section"><a href="ch02s03.html#Constants">Constants</a></span></li><li><span class="section"><a href="ch02s03s02.html">Path expressions</a></span></li><li><span class="section"><a href="ch02s03s03.html">Axis steps</a></span></li><li><span class="section"><a href="ch02s03s04.html">Set difference, intersection and Union</a></span></li><li><span class="section"><a href="ch02s03s05.html">Arithmetic Expressions</a></span><ul><li><span class="section"><a href="ch02s03s05.html#Unary">Unary</a></span></li><li><span class="section"><a href="ch02s03s05s02.html">Multiplication and Division:</a></span></li><li><span class="section"><a href="ch02s03s05s03.html">Addition and Subtraction:</a></span></li></ul></li><li><span class="section"><a href="ch02s03s06.html">Range expressions</a></span></li><li><span class="section"><a href="ch02s03s07.html">Comparisons</a></span></li><li><span class="section"><a href="ch02s03s08.html">Conditional Expressions</a></span></li><li><span class="section"><a href="ch02s03s09.html">Quantified Expressions</a></span></li><li><span class="section"><a href="ch02s03s10.html">And, Or Expressions</a></span></li><li><span class="section"><a href="ch02s03s11.html">SequenceType Matching Expressions</a></span></li></ul></li></ul></li><li><span class="chapter"><a href="ch03.html">How to use XPath 2.0 functions with PsychoPath</a></span><ul><li><span class="section"><a href="ch03.html#Accessors">Accessors</a></span></li><li><span class="section"><a href="ch03s02.html">Constructor Functions</a></span></li><li><span class="section"><a href="ch03s03.html">Functions on Numeric Values</a></span></li><li><span class="section"><a href="ch03s04.html">Functions to Assemble and Disassemble Strings</a></span></li><li><span class="section"><a href="ch03s05.html">Compare and Other Functions on String Values</a></span></li><li><span class="section"><a href="ch03s06.html">Functions Based on Substring Matching</a></span></li><li><span class="section"><a href="ch03s07.html">String Functions that Use Pattern Matching</a></span></li><li><span class="section"><a href="ch03s08.html">Functions on Boolean Values</a></span></li><li><span class="section"><a href="ch03s09.html">Component Extraction Functions on Durations, Dates and Times</a></span></li><li><span class="section"><a href="ch03s10.html">Functions Related to QNames</a></span></li><li><span class="section"><a href="ch03s11.html">Functions on Nodes</a></span><ul><li><span class="section"><a href="ch03s11.html#General_Functions_on_Sequences">General Functions on Sequences</a></span></li><li><span class="section"><a href="ch03s11s02.html">Functions That Test the Cardinality of Sequences</a></span></li><li><span class="section"><a href="ch03s11s03.html">Deep-Equal, Aggregate Functions, and Functions that Generate Sequences</a></span></li><li><span class="section"><a href="ch03s11s04.html">Context Functions</a></span></li></ul></li></ul></li><li><span class="chapter"><a href="ch04.html">How to use XPath 2.0 operators with PsychoPath</a></span><ul><li><span class="section"><a href="ch04.html#Operators_on_Numeric_Values">Operators on Numeric Values</a></span></li><li><span class="section"><a href="ch04s02.html">Comparison of Numeric Values</a></span></li><li><span class="section"><a href="ch04s03.html">Operators on Boolean Values</a></span></li><li><span class="section"><a href="ch04s04.html">Comparisons of Duration, Date and Time Values</a></span></li><li><span class="section"><a href="ch04s05.html">Arithmetic Functions on Durations</a></span></li><li><span class="section"><a href="ch04s06.html">Arithmetic Functions Dates and Times</a></span></li><li><span class="section"><a href="ch04s07.html">Operators Related to QNames And Nodes</a></span></li><li><span class="section"><a href="ch04s08.html">Union, Intersection and Except</a></span></li><li><span class="section"><a href="ch04s09.html">Operators that Generate Sequences</a></span></li></ul></li></ul></div></div></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/pom.xml b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/pom.xml
index 48cd7d4..543465b 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/pom.xml
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.doc.user/pom.xml
@@ -11,7 +11,7 @@
 	</parent>
 
 	<artifactId>org.eclipse.wst.xml.xpath2.processor.doc.user</artifactId>
-	<version>1.0.0-SNAPSHOT</version>
+	<version>2.0.0-SNAPSHOT</version>
 	<packaging>eclipse-plugin</packaging>
 	<name>PsychoPath XPath 2.0 Processor: User Documentation</name>
 </project>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/META-INF/MANIFEST.MF
index 94c602b..766ac11 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.xpath2.processor.sdk.doc; singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.xml.xpath2.processor.sdk.doc.Activator
 Require-Bundle: org.eclipse.core.runtime
 Bundle-ActivationPolicy: lazy
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/build.xml b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/build.xml
index 84bf003..3678959 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/build.xml
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/build.xml
@@ -20,14 +20,17 @@
          ================================= -->
     <target name="default" description="Builds SDK TOC Documentation using JELDoclet.">
 
-  	  <javadoc destdir="doc" package="true" docletpath="${workspace}/lib/jeldoclet.jar">
+  	  <javadoc destdir="doc" package="true" failonerror="no" docletpath="${workspace}/lib/jeldoclet.jar">
   	  	 <fileset dir="${workspaceloc}">
+	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/*.java"/>
+	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/api/typesystem/*.java"/>
 	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/*.java"/>
 	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/ast/*.java"/>
 	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/ast/*.java"/>
 	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/function/*.java"/>
 	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/*.java"/>
 	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/*.java"/>
+	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/builtin/*.java"/>
   	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/functions/*.java"/>
   	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/types/userdefined/*.java"/>
   	  	 	<include name="org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/internal/utils/*.java"/>
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.AtomicItemType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.AtomicItemType.html
new file mode 100644
index 0000000..676ecf0
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.AtomicItemType.html
@@ -0,0 +1,7 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class AtomicItemType</h2><br><hr><pre>public class <strong>AtomicItemType</strong>
+extends </pre>Defines an sequence or item of atomic types.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the schema type of the sequence or type.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p>Returns the schema type of the sequence or type.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - The Schema type of the sequence or item.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.CollationProvider.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.CollationProvider.html
new file mode 100644
index 0000000..b9e09e1
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.CollationProvider.html
@@ -0,0 +1,21 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class CollationProvider</h2><br><hr><pre>public class <strong>CollationProvider</strong>
+extends </pre>Service provider interface for looking up collations from within the
+ dynamic context.
+ 
+ Definition from the XPath2 specification: A collation is a specification of
+ the manner in which strings and URIs are compared and, by extension,
+ ordered. For a more complete definition of collation, see [XQuery 1.0 and
+ XPath 2.0 Functions and Operators (Second Edition)].<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  java.lang.String</code></td><td width="80%" align="left"><code><a href="#field_CODEPOINT_COLLATION">CODEPOINT_COLLATION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               The default collation which is guaranteed to always be implemented</td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Comparator</code></td><td width="" align="left"><code><a href="#method_getCollation">getCollation</a>(java.lang.String name)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Gets the named collator. W3C does not define collation names (yet?) so
+ we are constrained to using an implementation-defined naming scheme.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getDefaultCollation">getDefaultCollation</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_CODEPOINT_COLLATION">CODEPOINT_COLLATION</a></h2><p><code>public static  java.lang.String <strong>CODEPOINT_COLLATION</strong></code></p><table><tr><td>The default collation which is guaranteed to always be implemented</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getCollation">getCollation</a></h2><p><code>public java.util.Comparator <strong>getCollation</strong>(java.lang.String name)</code></p><p>Gets the named collator. W3C does not define collation names (yet?) so
+ we are constrained to using an implementation-defined naming scheme.</p><h3>Parameters</h3><p><code>name</code> - A URI designating the collation to use</p><h3>Returns</h3><p><code>java.util.Comparator</code> - The collation to use, or null if no such collation exists by          this provider</p><hr><h2><a name="method_getDefaultCollation">getDefaultCollation</a></h2><p><code>public java.lang.String <strong>getDefaultCollation</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.DynamicContext.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.DynamicContext.html
new file mode 100644
index 0000000..ce7f8b9
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.DynamicContext.html
@@ -0,0 +1,124 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class DynamicContext</h2><br><hr><pre>public class <strong>DynamicContext</strong>
+extends </pre>Interface for dynamic context. This covers the Dynamic Context as defined by the XPath2 specification, EXCEPT for 
+ context item and size (handled in EvaluationContext)<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider</code></td><td width="" align="left"><code><a href="#method_getCollationProvider">getCollationProvider</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Actual collation providers available for use dynamically. This could
+ differ from the collations available statically, but would give
+ unexpected results.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Map</code></td><td width="" align="left"><code><a href="#method_getCollections">getCollections</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Available collections. This is a mapping of
+ strings onto sequences of nodes. The string represents the absolute URI
+ of a resource. The sequence of nodes represents the result of the
+ fn:collection function when that URI is supplied as the argument. ] The
+ set of available collections is not limited to the set of statically
+ known collections, and it may be empty. For every document node D that
+ is in the target of a mapping in available collections, or that is the
+ root of a tree containing such a node, the document-uri property of D
+ must either be absent, or must be a URI U such that available documents
+ contains a mapping from U to D." Note: This means that for any document
+ node $N retrieved using the fn:collection function, either directly or
+ by navigating to the root of a node that was returned, the result of
+ fn:doc(fn:document-uri($N)) is $N will always be True, unless
+ fn:document-uri($N) is an empty sequence. This implies a requirement
+ for the fn:doc and fn:collection functions to be consistent in their
+ effect. If the implementation uses catalogs or user-supplied URI
+ resolvers to dereference URIs supplied to the fn:doc function, the
+ implementation of the fn:collection function must take these mechanisms
+ into account. For example, an implementation might achieve this by
+ mapping the collection URI to a set of document URIs, which are then
+ resolved using the same catalog or URI resolver that is used by the
+ fn:doc function.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.GregorianCalendar</code></td><td width="" align="left"><code><a href="#method_getCurrentDateTime">getCurrentDateTime</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Current dateTime. This
+ information represents an implementation-dependent point in time during
+ the processing of an expression, and includes an explicit timezone. It
+ can be retrieved by the fn:current-dateTime function. If invoked
+ multiple times during the execution of an expression, this function
+ always returns the same result.]
+
+ Returns the current date time using the GregorianCalendar.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getDefaultCollection">getDefaultCollection</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Default collection. This is the sequence
+ of nodes that would result from calling the fn:collection function with
+ no arguments.] The value of default collection may be initialized by
+ the implementation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.Document</code></td><td width="" align="left"><code><a href="#method_getDocument">getDocument</a>(java.net.URI uri)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Available documents. This is a mapping of
+ strings onto document nodes. The string represents the absolute URI of
+ a resource. The document node is the root of a tree that represents
+ that resource using the data model. The document node is returned by
+ the fn:doc function when applied to that URI.] The set of available
+ documents is not limited to the set of statically known documents, and
+ it may be empty. If there are one or more URIs in available documents
+ that map to a document node D, then the document-uri property of D must
+ either be absent, or must be one of these URIs. Note: This means that
+ given a document node $N, the result of fn:doc(fn:document-uri($N)) is
+ $N will always be True, unless fn:document-uri($N) is an empty
+ sequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.Node</code></td><td width="" align="left"><code><a href="#method_getLimitNode">getLimitNode</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns a "top" node which the XPath2 engine is not allowed to
+ leave</td></tr><tr valign="top"><td width="20%" align="right"><code>public javax.xml.datatype.Duration</code></td><td width="" align="left"><code><a href="#method_getTimezoneOffset">getTimezoneOffset</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Implicit timezone. This
+ is the timezone to be used when a date, time, or dateTime value that
+ does not have a timezone is used in a comparison or arithmetic
+ operation. The implicit timezone is an implementation-defined value of
+ type xs:dayTimeDuration. See [XML Schema] for the range of legal values
+ of a timezone.]</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_getVariable">getVariable</a>(javax.xml.namespace.QName name)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Get variable.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.net.URI</code></td><td width="" align="left"><code><a href="#method_resolveUri">resolveUri</a>(java.lang.String uri)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Resolve an URI</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getCollationProvider">getCollationProvider</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider <strong>getCollationProvider</strong>()</code></p><p>Actual collation providers available for use dynamically. This could
+ differ from the collations available statically, but would give
+ unexpected results.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.CollationProvider</code></p><hr><h2><a name="method_getCollections">getCollections</a></h2><p><code>public java.util.Map <strong>getCollections</strong>()</code></p><p>[Definition: Available collections. This is a mapping of
+ strings onto sequences of nodes. The string represents the absolute URI
+ of a resource. The sequence of nodes represents the result of the
+ fn:collection function when that URI is supplied as the argument. ] The
+ set of available collections is not limited to the set of statically
+ known collections, and it may be empty. For every document node D that
+ is in the target of a mapping in available collections, or that is the
+ root of a tree containing such a node, the document-uri property of D
+ must either be absent, or must be a URI U such that available documents
+ contains a mapping from U to D." Note: This means that for any document
+ node $N retrieved using the fn:collection function, either directly or
+ by navigating to the root of a node that was returned, the result of
+ fn:doc(fn:document-uri($N)) is $N will always be True, unless
+ fn:document-uri($N) is an empty sequence. This implies a requirement
+ for the fn:doc and fn:collection functions to be consistent in their
+ effect. If the implementation uses catalogs or user-supplied URI
+ resolvers to dereference URIs supplied to the fn:doc function, the
+ implementation of the fn:collection function must take these mechanisms
+ into account. For example, an implementation might achieve this by
+ mapping the collection URI to a set of document URIs, which are then
+ resolved using the same catalog or URI resolver that is used by the
+ fn:doc function.</p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_getCurrentDateTime">getCurrentDateTime</a></h2><p><code>public java.util.GregorianCalendar <strong>getCurrentDateTime</strong>()</code></p><p>[Definition: Current dateTime. This
+ information represents an implementation-dependent point in time during
+ the processing of an expression, and includes an explicit timezone. It
+ can be retrieved by the fn:current-dateTime function. If invoked
+ multiple times during the execution of an expression, this function
+ always returns the same result.]
+
+ Returns the current date time using the GregorianCalendar.</p><h3>Returns</h3><p><code>java.util.GregorianCalendar</code> - The current date and time, which will always be same for the dynamic context.</p><hr><h2><a name="method_getDefaultCollection">getDefaultCollection</a></h2><p><code>public java.util.List <strong>getDefaultCollection</strong>()</code></p><p>[Definition: Default collection. This is the sequence
+ of nodes that would result from calling the fn:collection function with
+ no arguments.] The value of default collection may be initialized by
+ the implementation.</p><h3>Returns</h3><p><code>java.util.List</code></p><hr><h2><a name="method_getDocument">getDocument</a></h2><p><code>public org.w3c.dom.Document <strong>getDocument</strong>(java.net.URI uri)</code></p><p>[Definition: Available documents. This is a mapping of
+ strings onto document nodes. The string represents the absolute URI of
+ a resource. The document node is the root of a tree that represents
+ that resource using the data model. The document node is returned by
+ the fn:doc function when applied to that URI.] The set of available
+ documents is not limited to the set of statically known documents, and
+ it may be empty. If there are one or more URIs in available documents
+ that map to a document node D, then the document-uri property of D must
+ either be absent, or must be one of these URIs. Note: This means that
+ given a document node $N, the result of fn:doc(fn:document-uri($N)) is
+ $N will always be True, unless fn:document-uri($N) is an empty
+ sequence.</p><h3>Parameters</h3><p><code>uri</code> - is the URI of the document.</p><h3>Returns</h3><p><code>org.w3c.dom.Document</code> - document.</p><hr><h2><a name="method_getLimitNode">getLimitNode</a></h2><p><code>public org.w3c.dom.Node <strong>getLimitNode</strong>()</code></p><p>Returns a "top" node which the XPath2 engine is not allowed to
+ leave</p><h3>Returns</h3><p><code>org.w3c.dom.Node</code> - DOM node which limits axis navigation.</p><hr><h2><a name="method_getTimezoneOffset">getTimezoneOffset</a></h2><p><code>public javax.xml.datatype.Duration <strong>getTimezoneOffset</strong>()</code></p><p>[Definition: Implicit timezone. This
+ is the timezone to be used when a date, time, or dateTime value that
+ does not have a timezone is used in a comparison or arithmetic
+ operation. The implicit timezone is an implementation-defined value of
+ type xs:dayTimeDuration. See [XML Schema] for the range of legal values
+ of a timezone.]</p><h3>Returns</h3><p><code>javax.xml.datatype.Duration</code> - current date time and implicit timezone.</p><hr><h2><a name="method_getVariable">getVariable</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>getVariable</strong>(javax.xml.namespace.QName name)</code></p><p>Get variable.</p><h3>Parameters</h3><p><code>name</code> - is the name of the variable.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - variable.</p><hr><h2><a name="method_resolveUri">resolveUri</a></h2><p><code>public java.net.URI <strong>resolveUri</strong>(java.lang.String uri)</code></p><p>Resolve an URI</p><h3>Parameters</h3><p><code>uri</code> - is the possibly relative URI to resolve</p><h3>Returns</h3><p><code>java.net.URI</code> - the absolutized, resolved URI.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.EvaluationContext.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.EvaluationContext.html
new file mode 100644
index 0000000..5360cb6
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.EvaluationContext.html
@@ -0,0 +1,73 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class EvaluationContext</h2><br><hr><pre>public class <strong>EvaluationContext</strong>
+extends </pre><p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_getContextItem">getContextItem</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Definition: The context item is the item currently being processed. An
+ item is either an atomic value or a node.
+ Definition: When the context
+ item is a node, it can also be referred to as the context node.
+ 
+ The
+ context item is returned by an expression consisting of a single dot
+ (.). When an expression E1/E2 or E1[E2] is evaluated, each item in the
+ sequence obtained by evaluating E1 becomes the context item in the
+ inner focus for an evaluation of E2.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_getContextPosition">getContextPosition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: The context position
+ is the position of the context item within the sequence of items
+ currently being processed.] It changes whenever the context item
+ changes. When the focus is defined, the value of the context position
+ is an integer greater than zero. The context position is returned by
+ the expression fn:position(). When an expression E1/E2 or E1[E2] is
+ evaluated, the context position in the inner focus for an evaluation of
+ E2 is the position of the context item in the sequence obtained by
+ evaluating E1. The position of the first item in a sequence is always 1
+ (one). The context position is always less than or equal to the context
+ size.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.DynamicContext</code></td><td width="" align="left"><code><a href="#method_getDynamicContext">getDynamicContext</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_getLastPosition">getLastPosition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: The context size is the number of items in the
+ sequence of items currently being processed.] Its value is always an
+ integer greater than zero. The context size is returned by the
+ expression fn:last(). When an expression E1/E2 or E1[E2] is evaluated,
+ the context size in the inner focus for an evaluation of E2 is the
+ number of items in the sequence obtained by evaluating E1. [Definition:
+ Variable values. This is a set of (expanded QName, value) pairs. It
+ contains the same expanded QNames as the in-scope variables in the
+ static context for the expression. The expanded QName is the name of
+ the variable and the value is the dynamic value of the variable, which
+ includes its dynamic type.]</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.StaticContext</code></td><td width="" align="left"><code><a href="#method_getStaticContext">getStaticContext</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getContextItem">getContextItem</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>getContextItem</strong>()</code></p><p>Definition: The context item is the item currently being processed. An
+ item is either an atomic value or a node.
+ Definition: When the context
+ item is a node, it can also be referred to as the context node.
+ 
+ The
+ context item is returned by an expression consisting of a single dot
+ (.). When an expression E1/E2 or E1[E2] is evaluated, each item in the
+ sequence obtained by evaluating E1 becomes the context item in the
+ inner focus for an evaluation of E2.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_getContextPosition">getContextPosition</a></h2><p><code>public int <strong>getContextPosition</strong>()</code></p><p>[Definition: The context position
+ is the position of the context item within the sequence of items
+ currently being processed.] It changes whenever the context item
+ changes. When the focus is defined, the value of the context position
+ is an integer greater than zero. The context position is returned by
+ the expression fn:position(). When an expression E1/E2 or E1[E2] is
+ evaluated, the context position in the inner focus for an evaluation of
+ E2 is the position of the context item in the sequence obtained by
+ evaluating E1. The position of the first item in a sequence is always 1
+ (one). The context position is always less than or equal to the context
+ size.</p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_getDynamicContext">getDynamicContext</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.DynamicContext <strong>getDynamicContext</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.DynamicContext</code> - The current dynamic context in effect.</p><hr><h2><a name="method_getLastPosition">getLastPosition</a></h2><p><code>public int <strong>getLastPosition</strong>()</code></p><p>[Definition: The context size is the number of items in the
+ sequence of items currently being processed.] Its value is always an
+ integer greater than zero. The context size is returned by the
+ expression fn:last(). When an expression E1/E2 or E1[E2] is evaluated,
+ the context size in the inner focus for an evaluation of E2 is the
+ number of items in the sequence obtained by evaluating E1. [Definition:
+ Variable values. This is a set of (expanded QName, value) pairs. It
+ contains the same expanded QNames as the in-scope variables in the
+ static context for the expression. The expanded QName is the name of
+ the variable and the value is the dynamic value of the variable, which
+ includes its dynamic type.]</p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_getStaticContext">getStaticContext</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.StaticContext <strong>getStaticContext</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.StaticContext</code> - The current static context in effect.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Function.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Function.html
new file mode 100644
index 0000000..b7d559c
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Function.html
@@ -0,0 +1,37 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class Function</h2><br><hr><pre>public class <strong>Function</strong>
+extends </pre>Support for functions.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_canMatchArity">canMatchArity</a>(int actualArity)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Checks if this function has an to the</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_computeReturnType">computeReturnType</a>(java.util.Collection args
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Evaluate the exact result type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_evaluate">evaluate</a>(java.util.Collection args
+         ,
+      org.eclipse.wst.xml.xpath2.api.EvaluationContext evaluationContext)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Evaluate arguments.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getArgumentNameHint">getArgumentNameHint</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Name hint for the index'th argument,  
+ starting at 0.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getArgumentType">getArgumentType</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the type of the argument at position index,
+ starting at 0.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_getMaxArity">getMaxArity</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Maximum number of allowed arguments.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_getMinArity">getMinArity</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Minimal number of allowed arguments.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getName">getName</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Support for QName interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getResultType">getResultType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Gets the return type for the function.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isVariableArgument">isVariableArgument</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Maximum number of allowed arguments.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_canMatchArity">canMatchArity</a></h2><p><code>public boolean <strong>canMatchArity</strong>(int actualArity)</code></p><p>Checks if this function has an to the</p><h3>Parameters</h3><p><code>actualArity</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_computeReturnType">computeReturnType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>computeReturnType</strong>(java.util.Collection args
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p>Evaluate the exact result type.</p><h3>Parameters</h3><p><code>args</code> - argument expressions.</p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - Result of evaluation.</p><hr><h2><a name="method_evaluate">evaluate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>evaluate</strong>(java.util.Collection args
+         ,
+      org.eclipse.wst.xml.xpath2.api.EvaluationContext evaluationContext)</code></p><p>Evaluate arguments.</p><h3>Parameters</h3><p><code>args</code> - argument expressions.</p><p><code>evaluationContext</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - Result of evaluation.</p><hr><h2><a name="method_getArgumentNameHint">getArgumentNameHint</a></h2><p><code>public java.lang.String <strong>getArgumentNameHint</strong>(int index)</code></p><p>Name hint for the index'th argument,  
+ starting at 0.</p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>java.lang.String</code> - TypeDefinition for the argument</p><hr><h2><a name="method_getArgumentType">getArgumentType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getArgumentType</strong>(int index)</code></p><p>Returns the type of the argument at position index,
+ starting at 0.</p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - TypeDefinition for the argument</p><hr><h2><a name="method_getMaxArity">getMaxArity</a></h2><p><code>public int <strong>getMaxArity</strong>()</code></p><p>Maximum number of allowed arguments.</p><h3>Returns</h3><p><code>int</code> - The highest number of arguments possible</p><hr><h2><a name="method_getMinArity">getMinArity</a></h2><p><code>public int <strong>getMinArity</strong>()</code></p><p>Minimal number of allowed arguments.</p><h3>Returns</h3><p><code>int</code> - The smallest number of arguments possible</p><hr><h2><a name="method_getName">getName</a></h2><p><code>public java.lang.String <strong>getName</strong>()</code></p><p>Support for QName interface.</p><h3>Returns</h3><p><code>java.lang.String</code> - Result of QName operation.</p><hr><h2><a name="method_getResultType">getResultType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getResultType</strong>()</code></p><p>Gets the return type for the function.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - TypeDefinition for the argument</p><hr><h2><a name="method_isVariableArgument">isVariableArgument</a></h2><p><code>public boolean <strong>isVariableArgument</strong>()</code></p><p>Maximum number of allowed arguments.</p><h3>Returns</h3><p><code>boolean</code> - The highest number of arguments possible</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.FunctionLibrary.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.FunctionLibrary.html
new file mode 100644
index 0000000..8364894
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.FunctionLibrary.html
@@ -0,0 +1,23 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class FunctionLibrary</h2><br><hr><pre>public class <strong>FunctionLibrary</strong>
+extends </pre>Interface for function libraries support.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  int</code></td><td width="80%" align="left"><code><a href="#field_VARIABLE_ARITY">VARIABLE_ARITY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_functionExists">functionExists</a>(java.lang.String name
+         ,
+      int arity)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Checks whether the function exists or not.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getNamespace">getNamespace</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the namespace of the function library.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Function</code></td><td width="" align="left"><code><a href="#method_resolveFunction">resolveFunction</a>(java.lang.String localName
+         ,
+      int arity)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Function support.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_VARIABLE_ARITY">VARIABLE_ARITY</a></h2><p><code>public static  int <strong>VARIABLE_ARITY</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_functionExists">functionExists</a></h2><p><code>public boolean <strong>functionExists</strong>(java.lang.String name
+         ,
+      int arity)</code></p><p>Checks whether the function exists or not.</p><h3>Parameters</h3><p><code>name</code> - Name of function.</p><p><code>arity</code> - arity of the function,</p><h3>Returns</h3><p><code>boolean</code> - Result of the test.</p><hr><h2><a name="method_getNamespace">getNamespace</a></h2><p><code>public java.lang.String <strong>getNamespace</strong>()</code></p><p>Returns the namespace of the function library.</p><h3>Returns</h3><p><code>java.lang.String</code> - Namespace.</p><hr><h2><a name="method_resolveFunction">resolveFunction</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Function <strong>resolveFunction</strong>(java.lang.String localName
+         ,
+      int arity)</code></p><p>Function support.</p><h3>Parameters</h3><p><code>localName</code></p><p><code>arity</code> - arity of the function.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Function</code> - The function from the library.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Item.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Item.html
new file mode 100644
index 0000000..a6a2c42
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Item.html
@@ -0,0 +1,11 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class Item</h2><br><hr><pre>public class <strong>Item</strong>
+extends </pre>An item in the XPath2 data model<p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_getItemType">getItemType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getItemType">getItemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>getItemType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code> - A description of the item type.</p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code> - The "Raw" Java object, e.g. org.w3.Node for a node,          java.util.String for strings, etc.</p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Match.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Match.html
new file mode 100644
index 0000000..84215e8
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.Match.html
@@ -0,0 +1,11 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class Match</h2><br><hr><pre>public class <strong>Match</strong>
+extends </pre>A match found by the XPath2 pattern matcher
+ 
+ * @noimplement This interface is not intended to be implemented by clients.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.XPath2Pattern</code></td><td width="" align="left"><code><a href="#method_getBestMatch">getBestMatch</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the XPath2 pattern which best matched the input (considering mode and priority)</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_getMatchingCount">getMatchingCount</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getBestMatch">getBestMatch</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.XPath2Pattern <strong>getBestMatch</strong>()</code></p><p>Returns the XPath2 pattern which best matched the input (considering mode and priority)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.XPath2Pattern</code> - Pattern which was the best match.</p><hr><h2><a name="method_getMatchingCount">getMatchingCount</a></h2><p><code>public int <strong>getMatchingCount</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code> - The number of matching patterns on the input.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence.html
new file mode 100644
index 0000000..2574e33
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence.html
@@ -0,0 +1,25 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class ResultBuffer.ArrayResultSequence</h2><br><hr><pre>public class <strong>ResultBuffer.ArrayResultSequence</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ResultBuffer.ArrayResultSequence">ResultBuffer.ArrayResultSequence</a></strong>(org.eclipse.wst.xml.xpath2.api.Item[] results)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_empty">empty</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_first">first</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_firstValue">firstValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_item">item</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_itemType">itemType</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_sequenceType">sequenceType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_value">value</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_ResultBuffer.ArrayResultSequence">ResultBuffer.ArrayResultSequence</a></h2><p><code>public <strong>ResultBuffer.ArrayResultSequence</strong>(org.eclipse.wst.xml.xpath2.api.Item[] results)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_firstValue">firstValue</a></h2><p><code>public java.lang.Object <strong>firstValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_item">item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>item</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_itemType">itemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>itemType</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Iterator</code></p><hr><h2><a name="method_sequenceType">sequenceType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>sequenceType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.Object <strong>value</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence.html
new file mode 100644
index 0000000..667f8d4
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence.html
@@ -0,0 +1,25 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class ResultBuffer.SingleResultSequence</h2><br><hr><pre>public class <strong>ResultBuffer.SingleResultSequence</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ResultBuffer.SingleResultSequence">ResultBuffer.SingleResultSequence</a></strong>(org.eclipse.wst.xml.xpath2.api.Item at)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_empty">empty</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_first">first</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_firstValue">firstValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_item">item</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_itemType">itemType</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_sequenceType">sequenceType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_value">value</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_ResultBuffer.SingleResultSequence">ResultBuffer.SingleResultSequence</a></h2><p><code>public <strong>ResultBuffer.SingleResultSequence</strong>(org.eclipse.wst.xml.xpath2.api.Item at)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_firstValue">firstValue</a></h2><p><code>public java.lang.Object <strong>firstValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_item">item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>item</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_itemType">itemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>itemType</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Iterator</code></p><hr><h2><a name="method_sequenceType">sequenceType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>sequenceType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.Object <strong>value</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.html
new file mode 100644
index 0000000..991c9d6
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.html
@@ -0,0 +1,41 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class ResultBuffer</h2><br><hr><pre>public class <strong>ResultBuffer</strong>
+extends java.lang.Object</pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="80%" align="left"><code><a href="#field_EMPTY">EMPTY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ResultBuffer">ResultBuffer</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_ResultBuffer.ArrayResultSequence">ResultBuffer.ArrayResultSequence</a></strong>(org.eclipse.wst.xml.xpath2.api.Item[] results)</code></td></tr><tr><td><code><strong><a href="#con_ResultBuffer.SingleResultSequence">ResultBuffer.SingleResultSequence</a></strong>(org.eclipse.wst.xml.xpath2.api.Item at)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></td><td width="" align="left"><code><a href="#method_add">add</a>(org.eclipse.wst.xml.xpath2.api.Item at)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_addAt">addAt</a>(int pos
+         ,
+      org.eclipse.wst.xml.xpath2.api.Item element)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></td><td width="" align="left"><code><a href="#method_append">append</a>(org.eclipse.wst.xml.xpath2.api.Item at)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_clear">clear</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></td><td width="" align="left"><code><a href="#method_concat">concat</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></td><td width="" align="left"><code><a href="#method_concat">concat</a>(java.util.Collection others)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Collection</code></td><td width="" align="left"><code><a href="#method_getCollection">getCollection</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_getSequence">getSequence</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_item">item</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.ListIterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_prepend">prepend</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_wrap">wrap</a>(org.eclipse.wst.xml.xpath2.api.Item item)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_EMPTY">EMPTY</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>EMPTY</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_ResultBuffer">ResultBuffer</a></h2><p><code>public <strong>ResultBuffer</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_add">add</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer <strong>add</strong>(org.eclipse.wst.xml.xpath2.api.Item at)</code></p><p></p><h3>Parameters</h3><p><code>at</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></p><hr><h2><a name="method_addAt">addAt</a></h2><p><code>public void <strong>addAt</strong>(int pos
+         ,
+      org.eclipse.wst.xml.xpath2.api.Item element)</code></p><p></p><h3>Parameters</h3><p><code>pos</code></p><p><code>element</code></p><hr><h2><a name="method_append">append</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer <strong>append</strong>(org.eclipse.wst.xml.xpath2.api.Item at)</code></p><p></p><h3>Parameters</h3><p><code>at</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></p><hr><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p></p><hr><h2><a name="method_concat">concat</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer <strong>concat</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></p><hr><h2><a name="method_concat">concat</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer <strong>concat</strong>(java.util.Collection others)</code></p><p></p><h3>Parameters</h3><p><code>others</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></p><hr><h2><a name="method_getCollection">getCollection</a></h2><p><code>public java.util.Collection <strong>getCollection</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Collection</code></p><hr><h2><a name="method_getSequence">getSequence</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>getSequence</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr><h2><a name="method_item">item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>item</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.ListIterator <strong>iterator</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.ListIterator</code></p><hr><h2><a name="method_prepend">prepend</a></h2><p><code>public void <strong>prepend</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_wrap">wrap</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>wrap</strong>(org.eclipse.wst.xml.xpath2.api.Item item)</code></p><p></p><h3>Parameters</h3><p><code>item</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultSequence.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultSequence.html
new file mode 100644
index 0000000..43bf64b
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.ResultSequence.html
@@ -0,0 +1,25 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class ResultSequence</h2><br><hr><pre>public class <strong>ResultSequence</strong>
+extends </pre>Immutable representation of a result<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_empty">empty</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Is the sequence empty.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_first">first</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_firstValue">firstValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Return the native representation of the first item.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_item">item</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Return the item.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_itemType">itemType</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               XPath2 type definition description of the item at location '0'</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Iterator of Item elements</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_sequenceType">sequenceType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Describe the whole sequence's type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Return the size of the result set. Only call this if you need it, since it may require that the entire result
+ is fetched.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_value">value</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Return the native representation of the item.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p>Is the sequence empty.</p><h3>Returns</h3><p><code>boolean</code> - true for empty sequences</p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_firstValue">firstValue</a></h2><p><code>public java.lang.Object <strong>firstValue</strong>()</code></p><p>Return the native representation of the first item.</p><h3>Returns</h3><p><code>java.lang.Object</code> - Native object representing the first item.</p><hr><h2><a name="method_item">item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>item</strong>(int index)</code></p><p>Return the item.</p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code> - Native object representing the item.</p><hr><h2><a name="method_itemType">itemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>itemType</strong>(int index)</code></p><p>XPath2 type definition description of the item at location '0'</p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p>Iterator of Item elements</p><h3>Returns</h3><p><code>java.util.Iterator</code></p><hr><h2><a name="method_sequenceType">sequenceType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>sequenceType</strong>()</code></p><p>Describe the whole sequence's type.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code> - Item type definition.</p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p>Return the size of the result set. Only call this if you need it, since it may require that the entire result
+ is fetched.</p><h3>Returns</h3><p><code>int</code> - Count of items.</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.Object <strong>value</strong>(int index)</code></p><p>Return the native representation of the item.</p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Native object representing the item.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.StaticContext.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.StaticContext.html
new file mode 100644
index 0000000..9b70f80
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.StaticContext.html
@@ -0,0 +1,157 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class StaticContext</h2><br><hr><pre>public class <strong>StaticContext</strong>
+extends </pre>interface to static context<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.net.URI</code></td><td width="" align="left"><code><a href="#method_getBaseUri">getBaseUri</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Base URI. This is an absolute URI, used when necessary in
+ the resolution of relative URIs (for example, by the fn:resolve-uri
+ function.)] The URI value is whitespace normalized according to the
+ rules for the xs:anyURI type in [XML Schema].</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider</code></td><td width="" align="left"><code><a href="#method_getCollationProvider">getCollationProvider</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Statically known collations. This is an
+ implementation-defined set of (URI, collation) pairs. It defines the
+ names of the collations that are available for use in processing
+ expressions.]</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getCollectionType">getCollectionType</a>(java.lang.String collectionName)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Statically known collections. This is a mapping from
+ strings onto types. The string represents the absolute URI of a
+ resource that is potentially available using the fn:collection
+ function. The type is the type of the sequence of nodes that would
+ result from calling the fn:collection function with this URI as its
+ argument.] If the argument to fn:collection is a string literal that is
+ not present in statically known collections, then the static type of
+ fn:collection is node()*. Note: The purpose of the statically known
+ collections is to provide static type information, not to determine
+ which collections are available. A URI need not be found in the
+ statically known collections to be accessed using fn:collection.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getDefaultCollectionType">getDefaultCollectionType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Statically known default collection type. This is the type
+ of the sequence of nodes that would result from calling the
+ fn:collection function with no arguments.] Unless initialized to some
+ other value by an implementation, the value of statically known default
+ collection type is node()*.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getDefaultFunctionNamespace">getDefaultFunctionNamespace</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Definition: Default function namespace. This is a namespace URI or
+ "none". The namespace URI, if present, is used for any unprefixed QName
+ appearing in a position where a function name is expected.] The URI
+ value is whitespace normalized according to the rules for the xs:anyURI
+ type in [XML Schema].</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getDefaultNamespace">getDefaultNamespace</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Default element/type namespace. This is a namespace URI or
+ "none". The namespace URI, if present, is used for any unprefixed QName
+ appearing in a position where an element or type name is expected.] The
+ URI value is whitespace normalized according to the rules for the
+ xs:anyURI type in [XML Schema].</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_getDocumentType">getDocumentType</a>(java.net.URI documentUri)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Statically known documents. This is a mapping from strings
+ onto types. The string represents the absolute URI of a resource that
+ is potentially available using the fn:doc function. The type is the
+ static type of a call to fn:doc with the given URI as its literal
+ argument. ] If the argument to fn:doc is a string literal that is not
+ present in statically known documents, then the static type of fn:doc
+ is document-node()?. Note: The purpose of the statically known
+ documents is to provide static type information, not to determine which
+ documents are available. A URI need not be found in the statically
+ known documents to be accessed using fn:doc.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Map</code></td><td width="" align="left"><code><a href="#method_getFunctionLibraries">getFunctionLibraries</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Function signatures. This component defines the set of
+ functions that are available to be called from within an expression.
+ Each function is uniquely identified by its expanded QName and its
+ arity (number of parameters).] In addition to the name and arity, each
+ function signature specifies the static types of the function
+ parameters and result. The function signatures include the signatures
+ of constructor functions, which are discussed in 3.10.4 Constructor
+ Functions.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getInitialContextType">getInitialContextType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Context item static type. This component defines the
+ static type of the context item within the scope of a given
+ expression.]</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.StaticVariableResolver</code></td><td width="" align="left"><code><a href="#method_getInScopeVariables">getInScopeVariables</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: In-scope variables. This is a set of (expanded QName,
+ type) pairs. It defines the set of variables that are available for
+ reference within an expression. The expanded QName is the name of the
+ variable, and the type is the static type of the variable.] An
+ expression that binds a variable (such as a for, some, or every
+ expression) extends the in-scope variables of its subexpressions with
+ the new bound variable and its type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public javax.xml.namespace.NamespaceContext</code></td><td width="" align="left"><code><a href="#method_getNamespaceContext">getNamespaceContext</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: Statically known namespaces. This is a set of (prefix,
+ URI) pairs that define all the namespaces that are known during static
+ processing of a given expression.] The URI value is whitespace
+ normalized according to the rules for the xs:anyURI type in [XML
+ Schema]. Note the difference between in-scope namespaces, which is a
+ dynamic property of an element node, and statically known namespaces,
+ which is a static property of an expression.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="" align="left"><code><a href="#method_getTypeModel">getTypeModel</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [Definition: In-scope schema definitions. This is a generic term for
+ all the element declarations, attribute declarations, and schema type
+ definitions that are in scope during processing of an expression.]</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isXPath1Compatible">isXPath1Compatible</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               XPath 1.0 compatibility mode.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Function</code></td><td width="" align="left"><code><a href="#method_resolveFunction">resolveFunction</a>(javax.xml.namespace.QName name
+         ,
+      int arity)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               is the function declared/available in the source context?</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getBaseUri">getBaseUri</a></h2><p><code>public java.net.URI <strong>getBaseUri</strong>()</code></p><p>[Definition: Base URI. This is an absolute URI, used when necessary in
+ the resolution of relative URIs (for example, by the fn:resolve-uri
+ function.)] The URI value is whitespace normalized according to the
+ rules for the xs:anyURI type in [XML Schema].</p><h3>Returns</h3><p><code>java.net.URI</code></p><hr><h2><a name="method_getCollationProvider">getCollationProvider</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider <strong>getCollationProvider</strong>()</code></p><p>[Definition: Statically known collations. This is an
+ implementation-defined set of (URI, collation) pairs. It defines the
+ names of the collations that are available for use in processing
+ expressions.]</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.CollationProvider</code></p><hr><h2><a name="method_getCollectionType">getCollectionType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getCollectionType</strong>(java.lang.String collectionName)</code></p><p>[Definition: Statically known collections. This is a mapping from
+ strings onto types. The string represents the absolute URI of a
+ resource that is potentially available using the fn:collection
+ function. The type is the type of the sequence of nodes that would
+ result from calling the fn:collection function with this URI as its
+ argument.] If the argument to fn:collection is a string literal that is
+ not present in statically known collections, then the static type of
+ fn:collection is node()*. Note: The purpose of the statically known
+ collections is to provide static type information, not to determine
+ which collections are available. A URI need not be found in the
+ statically known collections to be accessed using fn:collection.</p><h3>Parameters</h3><p><code>collectionName</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getDefaultCollectionType">getDefaultCollectionType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getDefaultCollectionType</strong>()</code></p><p>[Definition: Statically known default collection type. This is the type
+ of the sequence of nodes that would result from calling the
+ fn:collection function with no arguments.] Unless initialized to some
+ other value by an implementation, the value of statically known default
+ collection type is node()*.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getDefaultFunctionNamespace">getDefaultFunctionNamespace</a></h2><p><code>public java.lang.String <strong>getDefaultFunctionNamespace</strong>()</code></p><p>Definition: Default function namespace. This is a namespace URI or
+ "none". The namespace URI, if present, is used for any unprefixed QName
+ appearing in a position where a function name is expected.] The URI
+ value is whitespace normalized according to the rules for the xs:anyURI
+ type in [XML Schema].</p><h3>Returns</h3><p><code>java.lang.String</code> - The default function namespace</p><hr><h2><a name="method_getDefaultNamespace">getDefaultNamespace</a></h2><p><code>public java.lang.String <strong>getDefaultNamespace</strong>()</code></p><p>[Definition: Default element/type namespace. This is a namespace URI or
+ "none". The namespace URI, if present, is used for any unprefixed QName
+ appearing in a position where an element or type name is expected.] The
+ URI value is whitespace normalized according to the rules for the
+ xs:anyURI type in [XML Schema].</p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getDocumentType">getDocumentType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>getDocumentType</strong>(java.net.URI documentUri)</code></p><p>[Definition: Statically known documents. This is a mapping from strings
+ onto types. The string represents the absolute URI of a resource that
+ is potentially available using the fn:doc function. The type is the
+ static type of a call to fn:doc with the given URI as its literal
+ argument. ] If the argument to fn:doc is a string literal that is not
+ present in statically known documents, then the static type of fn:doc
+ is document-node()?. Note: The purpose of the statically known
+ documents is to provide static type information, not to determine which
+ documents are available. A URI need not be found in the statically
+ known documents to be accessed using fn:doc.</p><h3>Parameters</h3><p><code>documentUri</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_getFunctionLibraries">getFunctionLibraries</a></h2><p><code>public java.util.Map <strong>getFunctionLibraries</strong>()</code></p><p>[Definition: Function signatures. This component defines the set of
+ functions that are available to be called from within an expression.
+ Each function is uniquely identified by its expanded QName and its
+ arity (number of parameters).] In addition to the name and arity, each
+ function signature specifies the static types of the function
+ parameters and result. The function signatures include the signatures
+ of constructor functions, which are discussed in 3.10.4 Constructor
+ Functions.</p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_getInitialContextType">getInitialContextType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getInitialContextType</strong>()</code></p><p>[Definition: Context item static type. This component defines the
+ static type of the context item within the scope of a given
+ expression.]</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getInScopeVariables">getInScopeVariables</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.StaticVariableResolver <strong>getInScopeVariables</strong>()</code></p><p>[Definition: In-scope variables. This is a set of (expanded QName,
+ type) pairs. It defines the set of variables that are available for
+ reference within an expression. The expanded QName is the name of the
+ variable, and the type is the static type of the variable.] An
+ expression that binds a variable (such as a for, some, or every
+ expression) extends the in-scope variables of its subexpressions with
+ the new bound variable and its type.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.StaticVariableResolver</code></p><hr><h2><a name="method_getNamespaceContext">getNamespaceContext</a></h2><p><code>public javax.xml.namespace.NamespaceContext <strong>getNamespaceContext</strong>()</code></p><p>[Definition: Statically known namespaces. This is a set of (prefix,
+ URI) pairs that define all the namespaces that are known during static
+ processing of a given expression.] The URI value is whitespace
+ normalized according to the rules for the xs:anyURI type in [XML
+ Schema]. Note the difference between in-scope namespaces, which is a
+ dynamic property of an element node, and statically known namespaces,
+ which is a static property of an expression.</p><h3>Returns</h3><p><code>javax.xml.namespace.NamespaceContext</code> - The statically known namespace context</p><hr><h2><a name="method_getTypeModel">getTypeModel</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>getTypeModel</strong>()</code></p><p>[Definition: In-scope schema definitions. This is a generic term for
+ all the element declarations, attribute declarations, and schema type
+ definitions that are in scope during processing of an expression.]</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code> - A type model which covers the</p><hr><h2><a name="method_isXPath1Compatible">isXPath1Compatible</a></h2><p><code>public boolean <strong>isXPath1Compatible</strong>()</code></p><p>XPath 1.0 compatibility mode.</p><h3>Returns</h3><p><code>boolean</code> - true if rules for backward compatibility with XPath Version 1.0          are in effect; otherwise false.</p><hr><h2><a name="method_resolveFunction">resolveFunction</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Function <strong>resolveFunction</strong>(javax.xml.namespace.QName name
+         ,
+      int arity)</code></p><p>is the function declared/available in the source context?</p><h3>Parameters</h3><p><code>name</code> - is the qname name</p><p><code>arity</code> - integer of qname</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Function</code> - boolean</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.StaticVariableResolver.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.StaticVariableResolver.html
new file mode 100644
index 0000000..9a74b38
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.StaticVariableResolver.html
@@ -0,0 +1,9 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class StaticVariableResolver</h2><br><hr><pre>public class <strong>StaticVariableResolver</strong>
+extends </pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_getVariableType">getVariableType</a>(javax.xml.namespace.QName name)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isVariablePresent">isVariablePresent</a>(javax.xml.namespace.QName name)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Is the variable present in the current context.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getVariableType">getVariableType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>getVariableType</strong>(javax.xml.namespace.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_isVariablePresent">isVariablePresent</a></h2><p><code>public boolean <strong>isVariablePresent</strong>(javax.xml.namespace.QName name)</code></p><p>Is the variable present in the current context.</p><h3>Parameters</h3><p><code>name</code> - Variable name</p><h3>Returns</h3><p><code>boolean</code> - Availability of the variable</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Engine.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Engine.html
new file mode 100644
index 0000000..8f33a08
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Engine.html
@@ -0,0 +1,13 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class XPath2Engine</h2><br><hr><pre>public class <strong>XPath2Engine</strong>
+extends </pre>Main API for the XPath2 processor.<p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.XPath2Expression</code></td><td width="" align="left"><code><a href="#method_parseExpression">parseExpression</a>(java.lang.String expression
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext context)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Parse a full XPath2 expression and type check it against the static context
+ (if it provides a type model to check against)</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_parseExpression">parseExpression</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.XPath2Expression <strong>parseExpression</strong>(java.lang.String expression
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext context)</code></p><p>Parse a full XPath2 expression and type check it against the static context
+ (if it provides a type model to check against)</p><h3>Parameters</h3><p><code>expression</code> - String representation of XPath2 expression</p><p><code>context</code> - Static context for the expression.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.XPath2Expression</code> - A compiled expression.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Expression.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Expression.html
new file mode 100644
index 0000000..80b8e59
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Expression.html
@@ -0,0 +1,21 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class XPath2Expression</h2><br><hr><pre>public class <strong>XPath2Expression</strong>
+extends </pre>This interface represents a parsed and statically bound XPath2 expression.<p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_evaluate">evaluate</a>(org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext
+         ,
+      java.lang.Object[] contextItems)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Evaluate the XPath2 expression, using the supplied DynamicContext.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Collection</code></td><td width="" align="left"><code><a href="#method_getAxes">getAxes</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Return a collections of the axis used in the XPath2 expression.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Collection</code></td><td width="" align="left"><code><a href="#method_getFreeVariables">getFreeVariables</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Return a collections of QNames of the names of free variables referenced in the XPath expression.
+ These variables may be requested during evaluation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Collection</code></td><td width="" align="left"><code><a href="#method_getResolvedFunctions">getResolvedFunctions</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Return a collections of the functions used in the XPath2 expression.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isRootPathUsed">isRootPathUsed</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Whether or not the root path is in use in the XPath2 expression.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_evaluate">evaluate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>evaluate</strong>(org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext
+         ,
+      java.lang.Object[] contextItems)</code></p><p>Evaluate the XPath2 expression, using the supplied DynamicContext.</p><h3>Parameters</h3><p><code>dynamicContext</code> - Dynamic context for the expression.</p><p><code>contextItems</code> - Context item (typically nodes, often one) to evaluate under.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A ResultSequence</p><hr><h2><a name="method_getAxes">getAxes</a></h2><p><code>public java.util.Collection <strong>getAxes</strong>()</code></p><p>Return a collections of the axis used in the XPath2 expression.</p><h3>Returns</h3><p><code>java.util.Collection</code> - A Collection containing Strings with the axis names in use.</p><hr><h2><a name="method_getFreeVariables">getFreeVariables</a></h2><p><code>public java.util.Collection <strong>getFreeVariables</strong>()</code></p><p>Return a collections of QNames of the names of free variables referenced in the XPath expression.
+ These variables may be requested during evaluation.</p><h3>Returns</h3><p><code>java.util.Collection</code> - A Collection containing javax.xml.namespacing.QName of free variables</p><hr><h2><a name="method_getResolvedFunctions">getResolvedFunctions</a></h2><p><code>public java.util.Collection <strong>getResolvedFunctions</strong>()</code></p><p>Return a collections of the functions used in the XPath2 expression.</p><h3>Returns</h3><p><code>java.util.Collection</code> - A Collection containing javax.xml.namespacing.QName of functions in use.</p><hr><h2><a name="method_isRootPathUsed">isRootPathUsed</a></h2><p><code>public boolean <strong>isRootPathUsed</strong>()</code></p><p>Whether or not the root path is in use in the XPath2 expression.</p><h3>Returns</h3><p><code>boolean</code> - true if the expression uses / or //, false otherwise.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Pattern.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Pattern.html
new file mode 100644
index 0000000..ae2df86
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Pattern.html
@@ -0,0 +1,13 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class XPath2Pattern</h2><br><hr><pre>public class <strong>XPath2Pattern</strong>
+extends </pre>This is a compiled pattern (which is a simpler version of an expression, used to match in XSLT files, etc.)<p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getUserData">getUserData</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_matches">matches</a>(org.eclipse.wst.xml.xpath2.api.DynamicContext dc
+         ,
+      org.w3c.dom.Node context)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getUserData">getUserData</a></h2><p><code>public java.lang.Object <strong>getUserData</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code> - The object passed in my the caller when the patten was created.</p><hr><h2><a name="method_matches">matches</a></h2><p><code>public boolean <strong>matches</strong>(org.eclipse.wst.xml.xpath2.api.DynamicContext dc
+         ,
+      org.w3c.dom.Node context)</code></p><p></p><h3>Parameters</h3><p><code>dc</code></p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2PatternSet.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2PatternSet.html
new file mode 100644
index 0000000..824ec69
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.XPath2PatternSet.html
@@ -0,0 +1,33 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api</strong></font><br>
+               Class XPath2PatternSet</h2><br><hr><pre>public class <strong>XPath2PatternSet</strong>
+extends </pre><p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_clear">clear</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.XPath2Pattern</code></td><td width="" align="left"><code><a href="#method_compilePattern">compilePattern</a>(org.eclipse.wst.xml.xpath2.api.StaticContext context
+         ,
+      java.lang.String pattern
+         ,
+      java.lang.String mode
+         ,
+      int priority
+         ,
+      java.lang.Object userData)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Match</code></td><td width="" align="left"><code><a href="#method_match">match</a>(org.eclipse.wst.xml.xpath2.api.DynamicContext dc
+         ,
+      org.w3c.dom.Node context)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_removePattern">removePattern</a>(org.eclipse.wst.xml.xpath2.api.XPath2Pattern pattern)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p></p><hr><h2><a name="method_compilePattern">compilePattern</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.XPath2Pattern <strong>compilePattern</strong>(org.eclipse.wst.xml.xpath2.api.StaticContext context
+         ,
+      java.lang.String pattern
+         ,
+      java.lang.String mode
+         ,
+      int priority
+         ,
+      java.lang.Object userData)</code></p><p></p><h3>Parameters</h3><p><code>context</code></p><p><code>pattern</code></p><p><code>mode</code></p><p><code>priority</code></p><p><code>userData</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.XPath2Pattern</code></p><hr><h2><a name="method_match">match</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Match <strong>match</strong>(org.eclipse.wst.xml.xpath2.api.DynamicContext dc
+         ,
+      org.w3c.dom.Node context)</code></p><p></p><h3>Parameters</h3><p><code>dc</code></p><p><code>context</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Match</code></p><hr><h2><a name="method_removePattern">removePattern</a></h2><p><code>public void <strong>removePattern</strong>(org.eclipse.wst.xml.xpath2.api.XPath2Pattern pattern)</code></p><p></p><h3>Parameters</h3><p><code>pattern</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition.html
new file mode 100644
index 0000000..b1f2a8d
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition.html
@@ -0,0 +1,57 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api.typesystem</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api.typesystem</strong></font><br>
+               Class ComplexTypeDefinition</h2><br><hr><pre>public class <strong>ComplexTypeDefinition</strong>
+extends </pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_CONTENT_ELEMENT">CONTENT_ELEMENT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Represents an element-only content type. An element-only content type 
+ validates elements with children that conform to the supplied content 
+ model.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_CONTENT_EMPTY">CONTENT_EMPTY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Represents an empty content type. A content type with the distinguished 
+ value empty validates elements with no character or element 
+ information item children.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_CONTENT_MIXED">CONTENT_MIXED</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Represents a mixed content type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_CONTENT_SIMPLE">CONTENT_SIMPLE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Represents a simple content type. A content type which is simple 
+ validates elements with character-only children.</td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_getAbstract">getAbstract</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [abstract]: a boolean. Complex types for which <code>abstract</code> is 
+ true must not be used as the type definition for the validation of 
+ element information items.</td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getContentType">getContentType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a simple 
+ type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
+ <code>CONTENTTYPE_MIXED</code>), or element-only (
+ <code>CONTENTTYPE_ELEMENT</code>).</td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getDerivationMethod">getDerivationMethod</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [derivation method]: either <code>DERIVATION_EXTENSION</code>, 
+ <code>DERIVATION_RESTRICTION</code>, or <code>DERIVATION_NONE</code> 
+ (see <code>XSConstants</code>).</td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getProhibitedSubstitutions">getProhibitedSubstitutions</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [prohibited substitutions]: A subset of {extension, restriction} or 
+ <code>DERIVATION_NONE</code> represented as a bit flag (see 
+ <code>XSConstants</code>).</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition</code></td><td width="" align="left"><code><a href="#method_getSimpleType">getSimpleType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               A simple type definition corresponding to a simple content model, 
+ otherwise <code>null</code>.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isProhibitedSubstitution">isProhibitedSubstitution</a>(short restriction)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [prohibited substitutions]: a subset of {extension, restriction}</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_CONTENT_ELEMENT">CONTENT_ELEMENT</a></h2><p><code>public static  short <strong>CONTENT_ELEMENT</strong></code></p><table><tr><td>Represents an element-only content type. An element-only content type 
+ validates elements with children that conform to the supplied content 
+ model.</td></tr></table><hr><h2><a name="field_CONTENT_EMPTY">CONTENT_EMPTY</a></h2><p><code>public static  short <strong>CONTENT_EMPTY</strong></code></p><table><tr><td>Represents an empty content type. A content type with the distinguished 
+ value empty validates elements with no character or element 
+ information item children.</td></tr></table><hr><h2><a name="field_CONTENT_MIXED">CONTENT_MIXED</a></h2><p><code>public static  short <strong>CONTENT_MIXED</strong></code></p><table><tr><td>Represents a mixed content type.</td></tr></table><hr><h2><a name="field_CONTENT_SIMPLE">CONTENT_SIMPLE</a></h2><p><code>public static  short <strong>CONTENT_SIMPLE</strong></code></p><table><tr><td>Represents a simple content type. A content type which is simple 
+ validates elements with character-only children.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getAbstract">getAbstract</a></h2><p><code>public boolean <strong>getAbstract</strong>()</code></p><p>[abstract]: a boolean. Complex types for which <code>abstract</code> is 
+ true must not be used as the type definition for the validation of 
+ element information items.</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getContentType">getContentType</a></h2><p><code>public short <strong>getContentType</strong>()</code></p><p>[content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a simple 
+ type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
+ <code>CONTENTTYPE_MIXED</code>), or element-only (
+ <code>CONTENTTYPE_ELEMENT</code>).</p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getDerivationMethod">getDerivationMethod</a></h2><p><code>public short <strong>getDerivationMethod</strong>()</code></p><p>[derivation method]: either <code>DERIVATION_EXTENSION</code>, 
+ <code>DERIVATION_RESTRICTION</code>, or <code>DERIVATION_NONE</code> 
+ (see <code>XSConstants</code>).</p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getProhibitedSubstitutions">getProhibitedSubstitutions</a></h2><p><code>public short <strong>getProhibitedSubstitutions</strong>()</code></p><p>[prohibited substitutions]: A subset of {extension, restriction} or 
+ <code>DERIVATION_NONE</code> represented as a bit flag (see 
+ <code>XSConstants</code>).</p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getSimpleType">getSimpleType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition <strong>getSimpleType</strong>()</code></p><p>A simple type definition corresponding to a simple content model, 
+ otherwise <code>null</code>.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition</code></p><hr><h2><a name="method_isProhibitedSubstitution">isProhibitedSubstitution</a></h2><p><code>public boolean <strong>isProhibitedSubstitution</strong>(short restriction)</code></p><p>[prohibited substitutions]: a subset of {extension, restriction}</p><h3>Parameters</h3><p><code>restriction</code> - Extension or restriction constants (see     <code>XSConstants</code>).</p><h3>Returns</h3><p><code>boolean</code> - True if <code>restriction</code> is a prohibited substitution,     otherwise false.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ItemType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ItemType.html
new file mode 100644
index 0000000..e3de542
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ItemType.html
@@ -0,0 +1,21 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api.typesystem</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api.typesystem</strong></font><br>
+               Class ItemType</h2><br><hr><pre>public class <strong>ItemType</strong>
+extends </pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_ALWAYS_ONE_MASK">ALWAYS_ONE_MASK</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_MAYBE_MANY_MASK">MAYBE_MANY_MASK</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_OCCURRENCE_NONE_OR_MANY">OCCURRENCE_NONE_OR_MANY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_OCCURRENCE_ONE">OCCURRENCE_ONE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_OCCURRENCE_ONE_OR_MANY">OCCURRENCE_ONE_OR_MANY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_OCCURRENCE_OPTIONAL">OCCURRENCE_OPTIONAL</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getOccurrence">getOccurrence</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_ALWAYS_ONE_MASK">ALWAYS_ONE_MASK</a></h2><p><code>public static  short <strong>ALWAYS_ONE_MASK</strong></code></p><hr><h2><a name="field_MAYBE_MANY_MASK">MAYBE_MANY_MASK</a></h2><p><code>public static  short <strong>MAYBE_MANY_MASK</strong></code></p><hr><h2><a name="field_OCCURRENCE_NONE_OR_MANY">OCCURRENCE_NONE_OR_MANY</a></h2><p><code>public static  short <strong>OCCURRENCE_NONE_OR_MANY</strong></code></p><hr><h2><a name="field_OCCURRENCE_ONE">OCCURRENCE_ONE</a></h2><p><code>public static  short <strong>OCCURRENCE_ONE</strong></code></p><hr><h2><a name="field_OCCURRENCE_ONE_OR_MANY">OCCURRENCE_ONE_OR_MANY</a></h2><p><code>public static  short <strong>OCCURRENCE_ONE_OR_MANY</strong></code></p><hr><h2><a name="field_OCCURRENCE_OPTIONAL">OCCURRENCE_OPTIONAL</a></h2><p><code>public static  short <strong>OCCURRENCE_OPTIONAL</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getOccurrence">getOccurrence</a></h2><p><code>public short <strong>getOccurrence</strong>()</code></p><p></p><h3>Returns</h3><p><code>short</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType.html
new file mode 100644
index 0000000..a5b146c
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType.html
@@ -0,0 +1,13 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api.typesystem</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api.typesystem</strong></font><br>
+               Class NodeItemType</h2><br><hr><pre>public class <strong>NodeItemType</strong>
+extends </pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public javax.xml.namespace.QName</code></td><td width="" align="left"><code><a href="#method_getName">getName</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getNodeType">getNodeType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Node type as per list in org.w3c.dom.Node</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isWildcard">isWildcard</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               For attribute and element types, return whether the name
+ part of the type test is a wildcard.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getName">getName</a></h2><p><code>public javax.xml.namespace.QName <strong>getName</strong>()</code></p><p></p><h3>Returns</h3><p><code>javax.xml.namespace.QName</code> - name of the item type, if applicable, otherwise null</p><hr><h2><a name="method_getNodeType">getNodeType</a></h2><p><code>public short <strong>getNodeType</strong>()</code></p><p>Node type as per list in org.w3c.dom.Node</p><h3>Returns</h3><p><code>short</code> - The DOM node type</p><hr><h2><a name="method_isWildcard">isWildcard</a></h2><p><code>public boolean <strong>isWildcard</strong>()</code></p><p>For attribute and element types, return whether the name
+ part of the type test is a wildcard.</p><h3>Returns</h3><p><code>boolean</code> - Wildcard test?</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.PrimitiveType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.PrimitiveType.html
new file mode 100644
index 0000000..523ddfe
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.PrimitiveType.html
@@ -0,0 +1,29 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api.typesystem</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api.typesystem</strong></font><br>
+               Class PrimitiveType</h2><br><hr><pre>public class <strong>PrimitiveType</strong>
+extends </pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_construct">construct</a>(java.lang.Object content)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               validate a given string against this simple type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getInterfaceClass">getInterfaceClass</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getNativeType">getNativeType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isEqual">isEqual</a>(java.lang.Object value1
+         ,
+      java.lang.Object value2)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Check whether two actual values are equal.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDType">isIDType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Check whether this type is or is derived from ID.
+ REVISIT: this method makes ID special, which is not a good design.
+          but since ID is not a primitive, there doesn't seem to be a
+          clean way of doing it except to define special method like this.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_validate">validate</a>(java.lang.String content)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               validate a given string against this simple type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_validateNative">validateNative</a>(java.lang.Object content)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               validate a given string against this simple type.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_construct">construct</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>construct</strong>(java.lang.Object content)</code></p><p>validate a given string against this simple type.</p><h3>Parameters</h3><p><code>content</code> - the string value that needs to be validated</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code> - the actual value (QName, Boolean) of the string value</p><hr><h2><a name="method_getInterfaceClass">getInterfaceClass</a></h2><p><code>public java.lang.Class <strong>getInterfaceClass</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code> - the actual value (QName, Boolean) of the string value</p><hr><h2><a name="method_getNativeType">getNativeType</a></h2><p><code>public java.lang.Class <strong>getNativeType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code> - The expected native type (class or interface) to expect when calling getValue.</p><hr><h2><a name="method_isEqual">isEqual</a></h2><p><code>public boolean <strong>isEqual</strong>(java.lang.Object value1
+         ,
+      java.lang.Object value2)</code></p><p>Check whether two actual values are equal.</p><h3>Parameters</h3><p><code>value1</code> - the first value</p><p><code>value2</code> - the second value</p><h3>Returns</h3><p><code>boolean</code> - true if the two value are equal</p><hr><h2><a name="method_isIDType">isIDType</a></h2><p><code>public boolean <strong>isIDType</strong>()</code></p><p>Check whether this type is or is derived from ID.
+ REVISIT: this method makes ID special, which is not a good design.
+          but since ID is not a primitive, there doesn't seem to be a
+          clean way of doing it except to define special method like this.</p><h3>Returns</h3><p><code>boolean</code> - whether this simple type is or is derived from ID.</p><hr><h2><a name="method_validate">validate</a></h2><p><code>public boolean <strong>validate</strong>(java.lang.String content)</code></p><p>validate a given string against this simple type.</p><h3>Parameters</h3><p><code>content</code> - the string value that needs to be validated</p><h3>Returns</h3><p><code>boolean</code> - the actual value (QName, Boolean) of the string value</p><hr><h2><a name="method_validateNative">validateNative</a></h2><p><code>public boolean <strong>validateNative</strong>(java.lang.Object content)</code></p><p>validate a given string against this simple type.</p><h3>Parameters</h3><p><code>content</code> - the string value that needs to be validated</p><h3>Returns</h3><p><code>boolean</code> - the actual value (QName, Boolean) of the string value</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition.html
new file mode 100644
index 0000000..377418a
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition.html
@@ -0,0 +1,53 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api.typesystem</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api.typesystem</strong></font><br>
+               Class SimpleTypeDefinition</h2><br><hr><pre>public class <strong>SimpleTypeDefinition</strong>
+extends </pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_VARIETY_ABSENT">VARIETY_ABSENT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               The variety is absent for the anySimpleType definition.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_VARIETY_ATOMIC">VARIETY_ATOMIC</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               &lt;code&gt;Atomic&lt;/code&gt; type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_VARIETY_LIST">VARIETY_LIST</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               &lt;code&gt;List&lt;/code&gt; type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_VARIETY_UNION">VARIETY_UNION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               &lt;code&gt;Union&lt;/code&gt; type.</td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_getBounded">getBounded</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Fundamental Facet: bounded.</td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getBuiltInKind">getBuiltInKind</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the closest built-in type category this type represents or 
+ derived from. For example, if this simple type is a built-in derived 
+ type integer the <code>INTEGER_DV</code> is returned.
+ 
+ KILL!</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_getFinite">getFinite</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Fundamental Facet: cardinality.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getItemType">getItemType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               If variety is <code>list</code> the item type definition (an atomic or 
+ union simple type definition) is available, otherwise 
+ <code>null</code>.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getMemberTypes">getMemberTypes</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               If variety is <code>union</code> the list of member type definitions (a 
+ non-empty sequence of simple type definitions) is available, 
+ otherwise an empty <code>XSObjectList</code>.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_getNumeric">getNumeric</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Fundamental Facet: numeric.</td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getOrdered">getOrdered</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Fundamental Facet: ordered.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition</code></td><td width="" align="left"><code><a href="#method_getPrimitiveType">getPrimitiveType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               If variety is <code>atomic</code> the primitive type definition (a 
+ built-in primitive datatype definition or the simple ur-type 
+ definition) is available, otherwise <code>null</code>.</td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getVariety">getVariety</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               [variety]: one of {atomic, list, union} or absent.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_VARIETY_ABSENT">VARIETY_ABSENT</a></h2><p><code>public static  short <strong>VARIETY_ABSENT</strong></code></p><table><tr><td>The variety is absent for the anySimpleType definition.</td></tr></table><hr><h2><a name="field_VARIETY_ATOMIC">VARIETY_ATOMIC</a></h2><p><code>public static  short <strong>VARIETY_ATOMIC</strong></code></p><table><tr><td><code>Atomic</code> type.</td></tr></table><hr><h2><a name="field_VARIETY_LIST">VARIETY_LIST</a></h2><p><code>public static  short <strong>VARIETY_LIST</strong></code></p><table><tr><td><code>List</code> type.</td></tr></table><hr><h2><a name="field_VARIETY_UNION">VARIETY_UNION</a></h2><p><code>public static  short <strong>VARIETY_UNION</strong></code></p><table><tr><td><code>Union</code> type.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getBounded">getBounded</a></h2><p><code>public boolean <strong>getBounded</strong>()</code></p><p>Fundamental Facet: bounded.</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getBuiltInKind">getBuiltInKind</a></h2><p><code>public short <strong>getBuiltInKind</strong>()</code></p><p>Returns the closest built-in type category this type represents or 
+ derived from. For example, if this simple type is a built-in derived 
+ type integer the <code>INTEGER_DV</code> is returned.
+ 
+ KILL!</p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getFinite">getFinite</a></h2><p><code>public boolean <strong>getFinite</strong>()</code></p><p>Fundamental Facet: cardinality.</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getItemType">getItemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getItemType</strong>()</code></p><p>If variety is <code>list</code> the item type definition (an atomic or 
+ union simple type definition) is available, otherwise 
+ <code>null</code>.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getMemberTypes">getMemberTypes</a></h2><p><code>public java.util.List <strong>getMemberTypes</strong>()</code></p><p>If variety is <code>union</code> the list of member type definitions (a 
+ non-empty sequence of simple type definitions) is available, 
+ otherwise an empty <code>XSObjectList</code>.</p><h3>Returns</h3><p><code>java.util.List</code></p><hr><h2><a name="method_getNumeric">getNumeric</a></h2><p><code>public boolean <strong>getNumeric</strong>()</code></p><p>Fundamental Facet: numeric.</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getOrdered">getOrdered</a></h2><p><code>public short <strong>getOrdered</strong>()</code></p><p>Fundamental Facet: ordered.</p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getPrimitiveType">getPrimitiveType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition <strong>getPrimitiveType</strong>()</code></p><p>If variety is <code>atomic</code> the primitive type definition (a 
+ built-in primitive datatype definition or the simple ur-type 
+ definition) is available, otherwise <code>null</code>.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition</code></p><hr><h2><a name="method_getVariety">getVariety</a></h2><p><code>public short <strong>getVariety</strong>()</code></p><p>[variety]: one of {atomic, list, union} or absent.</p><h3>Returns</h3><p><code>short</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition.html
new file mode 100644
index 0000000..4bbf250
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition.html
@@ -0,0 +1,47 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api.typesystem</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api.typesystem</strong></font><br>
+               Class TypeDefinition</h2><br><hr><pre>public class <strong>TypeDefinition</strong>
+extends </pre><p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_DERIVATION_EXTENSION">DERIVATION_EXTENSION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_DERIVATION_LIST">DERIVATION_LIST</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_DERIVATION_NONE">DERIVATION_NONE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_DERIVATION_RESTRICTION">DERIVATION_RESTRICTION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_DERIVATION_SUBSTITUTION">DERIVATION_SUBSTITUTION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_DERIVATION_UNION">DERIVATION_UNION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_derivedFrom">derivedFrom</a>(java.lang.String namespace
+         ,
+      java.lang.String name
+         ,
+      short derivationMethod)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_derivedFromType">derivedFromType</a>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition ancestorType
+         ,
+      short derivationMethod)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getBaseType">getBaseType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getName">getName</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getNamespace">getNamespace</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getNativeType">getNativeType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getSimpleTypes">getSimpleTypes</a>(org.w3c.dom.Attr attr)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getSimpleTypes">getSimpleTypes</a>(org.w3c.dom.Element attr)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_DERIVATION_EXTENSION">DERIVATION_EXTENSION</a></h2><p><code>public static  short <strong>DERIVATION_EXTENSION</strong></code></p><hr><h2><a name="field_DERIVATION_LIST">DERIVATION_LIST</a></h2><p><code>public static  short <strong>DERIVATION_LIST</strong></code></p><hr><h2><a name="field_DERIVATION_NONE">DERIVATION_NONE</a></h2><p><code>public static  short <strong>DERIVATION_NONE</strong></code></p><hr><h2><a name="field_DERIVATION_RESTRICTION">DERIVATION_RESTRICTION</a></h2><p><code>public static  short <strong>DERIVATION_RESTRICTION</strong></code></p><hr><h2><a name="field_DERIVATION_SUBSTITUTION">DERIVATION_SUBSTITUTION</a></h2><p><code>public static  short <strong>DERIVATION_SUBSTITUTION</strong></code></p><hr><h2><a name="field_DERIVATION_UNION">DERIVATION_UNION</a></h2><p><code>public static  short <strong>DERIVATION_UNION</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_derivedFrom">derivedFrom</a></h2><p><code>public boolean <strong>derivedFrom</strong>(java.lang.String namespace
+         ,
+      java.lang.String name
+         ,
+      short derivationMethod)</code></p><p></p><h3>Parameters</h3><p><code>namespace</code></p><p><code>name</code></p><p><code>derivationMethod</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_derivedFromType">derivedFromType</a></h2><p><code>public boolean <strong>derivedFromType</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition ancestorType
+         ,
+      short derivationMethod)</code></p><p></p><h3>Parameters</h3><p><code>ancestorType</code></p><p><code>derivationMethod</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getBaseType">getBaseType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getBaseType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getName">getName</a></h2><p><code>public java.lang.String <strong>getName</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getNamespace">getNamespace</a></h2><p><code>public java.lang.String <strong>getNamespace</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getNativeType">getNativeType</a></h2><p><code>public java.lang.Class <strong>getNativeType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_getSimpleTypes">getSimpleTypes</a></h2><p><code>public java.util.List <strong>getSimpleTypes</strong>(org.w3c.dom.Attr attr)</code></p><p></p><h3>Parameters</h3><p><code>attr</code></p><h3>Returns</h3><p><code>java.util.List</code></p><hr><h2><a name="method_getSimpleTypes">getSimpleTypes</a></h2><p><code>public java.util.List <strong>getSimpleTypes</strong>(org.w3c.dom.Element attr)</code></p><p></p><h3>Parameters</h3><p><code>attr</code></p><h3>Returns</h3><p><code>java.util.List</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel.html
new file mode 100644
index 0000000..b699a2b
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel.html
@@ -0,0 +1,25 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.api.typesystem</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.api.typesystem</strong></font><br>
+               Class TypeModel</h2><br><hr><pre>public class <strong>TypeModel</strong>
+extends </pre><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getType">getType</a>(org.w3c.dom.Node node)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_lookupAttributeDeclaration">lookupAttributeDeclaration</a>(java.lang.String namespace
+         ,
+      java.lang.String attributeName)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_lookupElementDeclaration">lookupElementDeclaration</a>(java.lang.String namespace
+         ,
+      java.lang.String elementName)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_lookupType">lookupType</a>(java.lang.String namespace
+         ,
+      java.lang.String typeName)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getType">getType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getType</strong>(org.w3c.dom.Node node)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_lookupAttributeDeclaration">lookupAttributeDeclaration</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>lookupAttributeDeclaration</strong>(java.lang.String namespace
+         ,
+      java.lang.String attributeName)</code></p><p></p><h3>Parameters</h3><p><code>namespace</code></p><p><code>attributeName</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_lookupElementDeclaration">lookupElementDeclaration</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>lookupElementDeclaration</strong>(java.lang.String namespace
+         ,
+      java.lang.String elementName)</code></p><p></p><h3>Parameters</h3><p><code>namespace</code></p><p><code>elementName</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_lookupType">lookupType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>lookupType</strong>(java.lang.String namespace
+         ,
+      java.lang.String typeName)</code></p><p></p><h3>Parameters</h3><p><code>namespace</code></p><p><code>typeName</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.CollationProvider.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.CollationProvider.html
index 8f77a22..92c8d37 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.CollationProvider.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.CollationProvider.html
@@ -1,6 +1,6 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class CollationProvider</h2><br><hr><pre>public class <strong>CollationProvider</strong>
-extends </pre>Service provider interface for looking up collations from within the dynamic context.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Comparator</code></td><td width="" align="left"><code><a href="#method_get_collation">get_collation</a>(java.lang.String name)</code><br>
+extends </pre>Service provider interface for looking up collations from within the dynamic context.<p></p><p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Comparator</code></td><td width="" align="left"><code><a href="#method_get_collation">get_collation</a>(java.lang.String name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Gets the named collator. W3C does not define collation names (yet?) so we are constrained to using an
  implementation-defined naming scheme.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DOMLoaderException.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DOMLoaderException.html
index 66a8e22..6bdbaf5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DOMLoaderException.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DOMLoaderException.html
@@ -1,5 +1,5 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class DOMLoaderException</h2><br><hr><pre>public class <strong>DOMLoaderException</strong>
-extends org.eclipse.wst.xml.xpath2.processor.XPathException</pre>Exception caused by DOM loader.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DOMLoaderException">DOMLoaderException</a></strong>(java.lang.String reason)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+extends org.eclipse.wst.xml.xpath2.processor.XPathException</pre>Exception caused by DOM loader.<p></p><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DOMLoaderException">DOMLoaderException</a></strong>(java.lang.String reason)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_DOMLoaderException">DOMLoaderException</a></h2><p><code>public <strong>DOMLoaderException</strong>(java.lang.String reason)</code></p><p>Constructor for DOM loader exception.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext.html
index fffa7e1..094f0c6 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext.html
@@ -3,9 +3,9 @@
 extends org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext</pre>The default implementation of a Dynamic Context.
  
  Initializes and provides functionality of a dynamic context according to the
- XPath 2.0 specification.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultDynamicContext">DefaultDynamicContext</a></strong>(org.apache.xerces.xs.XSModel schema
+ XPath 2.0 specification.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultDynamicContext">DefaultDynamicContext</a></strong>(XSModel schema
          ,
-      org.w3c.dom.Document doc)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_function_library">add_function_library</a>(FunctionLibrary fl)</code><br>
+      org.w3c.dom.Document doc)</code></td></tr><tr><td><code><strong><a href="#con_DefaultDynamicContext">DefaultDynamicContext</a></strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel schema)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_function_library">add_function_library</a>(FunctionLibrary fl)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Adds function definitions.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_context_item">context_item</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -25,9 +25,11 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_get_doc">get_doc</a>(java.net.URI resolved)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               get document</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get_variable">get_variable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
+               get document</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_get_variable">get_variable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieve the variable name</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_last">last</a>()</code><br>
+               Retrieve the variable name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="" align="left"><code><a href="#method_getTypeModel">getTypeModel</a>(org.w3c.dom.Node node)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_last">last</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieve the position of the last focus</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_node_position">node_position</a>(org.w3c.dom.Node node)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -43,16 +45,22 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Sets the value of a variable.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code></td><td width="" align="left"><code><a href="#method_tz">tz</a>()</code><br>
+               Sets the value of a variable.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_set_variable">set_variable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+         ,
+      org.eclipse.wst.xml.xpath2.processor.ResultSequence val)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code></td><td width="" align="left"><code><a href="#method_tz">tz</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Reads the day from a TimeDuration type</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_DefaultDynamicContext">DefaultDynamicContext</a></h2><p><code>public <strong>DefaultDynamicContext</strong>(org.apache.xerces.xs.XSModel schema
+               </h2></td></tr></table><h2><a name="con_DefaultDynamicContext">DefaultDynamicContext</a></h2><p><code>public <strong>DefaultDynamicContext</strong>(XSModel schema
          ,
-      org.w3c.dom.Document doc)</code></p><p>Constructor.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+      org.w3c.dom.Document doc)</code></p><p>Constructor.</p><hr><h2><a name="con_DefaultDynamicContext">DefaultDynamicContext</a></h2><p><code>public <strong>DefaultDynamicContext</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel schema)</code></p><p>Constructor.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
                </h2></td></tr></table><h2><a name="method_add_function_library">add_function_library</a></h2><p><code>public void <strong>add_function_library</strong>(FunctionLibrary fl)</code></p><p>Adds function definitions.</p><h3>Parameters</h3><p><code>fl</code> - Function library to add.</p><hr><h2><a name="method_context_item">context_item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>context_item</strong>()</code></p><p>Retrieve context item that is in focus</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - an AnyType result from _focus.context_item()</p><hr><h2><a name="method_context_position">context_position</a></h2><p><code>public int <strong>context_position</strong>()</code></p><p>Retrieve the position of the focus</p><h3>Returns</h3><p><code>int</code> - an integer result from _focus.position()</p><hr><h2><a name="method_current_date_time">current_date_time</a></h2><p><code>public java.util.GregorianCalendar <strong>current_date_time</strong>()</code></p><p>Gets the Current stable date time from the dynamic context.</p><h3>Returns</h3><p><code>java.util.GregorianCalendar</code></p><hr><h2><a name="method_default_collation_name">default_collation_name</a></h2><p><code>public java.lang.String <strong>default_collation_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_evaluate_function">evaluate_function</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>evaluate_function</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
          ,
-      java.util.Collection args)</code></p><p></p><h3>Parameters</h3><p><code>name</code></p><p><code>args</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - a ResultSequence from funct.evaluate(args)</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_focus">focus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.Focus <strong>focus</strong>()</code></p><p>Return the focus</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.Focus</code> - _focus</p><hr><h2><a name="method_get_collation">get_collation</a></h2><p><code>public java.util.Comparator <strong>get_collation</strong>(java.lang.String uri)</code></p><p></p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>java.util.Comparator</code></p><hr><h2><a name="method_get_doc">get_doc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>get_doc</strong>(java.net.URI resolved)</code></p><p>get document</p><h3>Parameters</h3><p><code>resolved</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - a ResultSequence from ResultSequenceFactory.create_new()</p><hr><h2><a name="method_get_variable">get_variable</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Retrieve the variable name</p><h3>Parameters</h3><p><code>name</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - an AnyType result from get_var(name) or return NULL</p><hr><h2><a name="method_last">last</a></h2><p><code>public int <strong>last</strong>()</code></p><p>Retrieve the position of the last focus</p><h3>Returns</h3><p><code>int</code> - an integer result from _focus.last()</p><hr><h2><a name="method_node_position">node_position</a></h2><p><code>public int <strong>node_position</strong>(org.w3c.dom.Node node)</code></p><p>Use focus().position() to retrieve the value.</p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_resolve_uri">resolve_uri</a></h2><p><code>public java.net.URI <strong>resolve_uri</strong>(java.lang.String uri)</code></p><p></p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>java.net.URI</code></p><hr><h2><a name="method_set_collation_provider">set_collation_provider</a></h2><p><code>public void <strong>set_collation_provider</strong>(org.eclipse.wst.xml.xpath2.processor.CollationProvider provider)</code></p><p></p><h3>Parameters</h3><p><code>provider</code></p><hr><h2><a name="method_set_default_collation">set_default_collation</a></h2><p><code>public void <strong>set_default_collation</strong>(java.lang.String _default_collation)</code></p><p></p><h3>Parameters</h3><p><code>_default_collation</code></p><hr><h2><a name="method_set_focus">set_focus</a></h2><p><code>public void <strong>set_focus</strong>(org.eclipse.wst.xml.xpath2.processor.internal.Focus f)</code></p><p>Changes the current focus.</p><h3>Parameters</h3><p><code>f</code> - focus to set</p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>public void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+      java.util.Collection args)</code></p><p></p><h3>Parameters</h3><p><code>name</code></p><p><code>args</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - a ResultSequence from funct.evaluate(args)</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_focus">focus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.Focus <strong>focus</strong>()</code></p><p>Return the focus</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.Focus</code> - _focus</p><hr><h2><a name="method_get_collation">get_collation</a></h2><p><code>public java.util.Comparator <strong>get_collation</strong>(java.lang.String uri)</code></p><p></p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>java.util.Comparator</code></p><hr><h2><a name="method_get_doc">get_doc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>get_doc</strong>(java.net.URI resolved)</code></p><p>get document</p><h3>Parameters</h3><p><code>resolved</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - a ResultSequence from ResultSequenceFactory.create_new()</p><hr><h2><a name="method_get_variable">get_variable</a></h2><p><code>public java.lang.Object <strong>get_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Retrieve the variable name</p><h3>Parameters</h3><p><code>name</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - an AnyType result from get_var(name) or return NULL</p><hr><h2><a name="method_getTypeModel">getTypeModel</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>getTypeModel</strong>(org.w3c.dom.Node node)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></p><hr><h2><a name="method_last">last</a></h2><p><code>public int <strong>last</strong>()</code></p><p>Retrieve the position of the last focus</p><h3>Returns</h3><p><code>int</code> - an integer result from _focus.last()</p><hr><h2><a name="method_node_position">node_position</a></h2><p><code>public int <strong>node_position</strong>(org.w3c.dom.Node node)</code></p><p>Use focus().position() to retrieve the value.</p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_resolve_uri">resolve_uri</a></h2><p><code>public java.net.URI <strong>resolve_uri</strong>(java.lang.String uri)</code></p><p></p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>java.net.URI</code></p><hr><h2><a name="method_set_collation_provider">set_collation_provider</a></h2><p><code>public void <strong>set_collation_provider</strong>(org.eclipse.wst.xml.xpath2.processor.CollationProvider provider)</code></p><p></p><h3>Parameters</h3><p><code>provider</code></p><hr><h2><a name="method_set_default_collation">set_default_collation</a></h2><p><code>public void <strong>set_default_collation</strong>(java.lang.String _default_collation)</code></p><p></p><h3>Parameters</h3><p><code>_default_collation</code></p><hr><h2><a name="method_set_focus">set_focus</a></h2><p><code>public void <strong>set_focus</strong>(org.eclipse.wst.xml.xpath2.processor.internal.Focus f)</code></p><p>Changes the current focus.</p><h3>Parameters</h3><p><code>f</code> - focus to set</p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>public void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
          ,
-      org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code></p><p>Sets the value of a variable.</p><h3>Parameters</h3><p><code>var</code> - Variable name.</p><p><code>val</code> - Variable value.</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Reads the day from a TimeDuration type</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - an xs:integer _tz</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code></p><p>Sets the value of a variable.</p><h3>Parameters</h3><p><code>var</code> - Variable name.</p><p><code>val</code> - Variable value.</p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>public void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+         ,
+      org.eclipse.wst.xml.xpath2.processor.ResultSequence val)</code></p><p></p><h3>Parameters</h3><p><code>var</code></p><p><code>val</code></p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Reads the day from a TimeDuration type</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - an xs:integer _tz</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope.html
new file mode 100644
index 0000000..e82f7f4
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope.html
@@ -0,0 +1,21 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
+               Class DefaultEvaluator.VariableScope</h2><br><hr><pre>package-private class <strong>DefaultEvaluator.VariableScope</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></td><td width="80%" align="left"><code><a href="#field_name">name</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope</code></td><td width="80%" align="left"><code><a href="#field_nextScope">nextScope</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="80%" align="left"><code><a href="#field_value">value</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator.VariableScope">DefaultEvaluator.VariableScope</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.api.ResultSequence value
+         ,
+      org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope nextScope)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong></code></p><hr><h2><a name="field_nextScope">nextScope</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope <strong>nextScope</strong></code></p><hr><h2><a name="field_value">value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>value</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_DefaultEvaluator.VariableScope">DefaultEvaluator.VariableScope</a></h2><p><code>public <strong>DefaultEvaluator.VariableScope</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.api.ResultSequence value
+         ,
+      org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope nextScope)</code></p><p></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.html
index 152c421..5c5b34c 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.html
@@ -1,12 +1,26 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class DefaultEvaluator</h2><br><hr><pre>public class <strong>DefaultEvaluator</strong>
-extends java.lang.Object</pre>Default evaluator interface<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator">DefaultEvaluator</a></strong>(org.eclipse.wst.xml.xpath2.processor.DynamicContext dc
+extends java.lang.Object</pre>Default evaluator interface<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator">DefaultEvaluator</a></strong>(org.eclipse.wst.xml.xpath2.processor.DynamicContext dynamicContext
          ,
-      org.w3c.dom.Document doc)</code></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator.DummyError">DefaultEvaluator.DummyError</a></strong>(int type)</code></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator.Pair">DefaultEvaluator.Pair</a></strong>(java.lang.Object o
+      org.w3c.dom.Document doc)</code></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator">DefaultEvaluator</a></strong>(org.eclipse.wst.xml.xpath2.api.StaticContext staticContext
          ,
-      java.lang.Object t)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_evaluate">evaluate</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext
+         ,
+      java.lang.Object[] contextItems)</code></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator.Pair">DefaultEvaluator.Pair</a></strong>(java.lang.Object o
+         ,
+      java.lang.Object t)</code></td></tr><tr><td><code><strong><a href="#con_DefaultEvaluator.VariableScope">DefaultEvaluator.VariableScope</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.api.ResultSequence value
+         ,
+      org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope nextScope)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_evaluate">evaluate</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               evaluate the xpath node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_visit">visit</a>(org.eclipse.wst.xml.xpath2.processor.ast.XPath xp)</code><br>
+               evaluate the xpath node</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_evaluate2">evaluate2</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>package-private org.eclipse.wst.xml.xpath2.processor.internal.Focus</code></td><td width="" align="left"><code><a href="#method_focus">focus</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>package-private void</code></td><td width="" align="left"><code><a href="#method_set_focus">set_focus</a>(org.eclipse.wst.xml.xpath2.processor.internal.Focus f)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_visit">visit</a>(org.eclipse.wst.xml.xpath2.processor.ast.XPath xp)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                iterate through xpath expression</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_visit">visit</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ForExpr fex)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -108,8 +122,12 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                visit filter expression</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_DefaultEvaluator">DefaultEvaluator</a></h2><p><code>public <strong>DefaultEvaluator</strong>(org.eclipse.wst.xml.xpath2.processor.DynamicContext dc
+               </h2></td></tr></table><h2><a name="con_DefaultEvaluator">DefaultEvaluator</a></h2><p><code>public <strong>DefaultEvaluator</strong>(org.eclipse.wst.xml.xpath2.processor.DynamicContext dynamicContext
          ,
-      org.w3c.dom.Document doc)</code></p><p>set parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+      org.w3c.dom.Document doc)</code></p><p></p><hr><h2><a name="con_DefaultEvaluator">DefaultEvaluator</a></h2><p><code>public <strong>DefaultEvaluator</strong>(org.eclipse.wst.xml.xpath2.api.StaticContext staticContext
+         ,
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext
+         ,
+      java.lang.Object[] contextItems)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_evaluate">evaluate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>evaluate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code></p><p>evaluate the xpath node</p><h3>Parameters</h3><p><code>node</code> - is the xpath node.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - result sequence.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.ast.XPath xp)</code></p><p>iterate through xpath expression</p><h3>Parameters</h3><p><code>xp</code> - is the xpath.</p><h3>Returns</h3><p><code>java.lang.Object</code> - result sequence.</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ForExpr fex)</code></p><p>visit for expression</p><h3>Parameters</h3><p><code>fex</code> - is the for expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function.</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.QuantifiedExpr qex)</code></p><p>visit quantified expression</p><h3>Parameters</h3><p><code>qex</code> - is the quantified expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function or null.</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IfExpr ifex)</code></p><p>visit if expression</p><h3>Parameters</h3><p><code>ifex</code> - is the if expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a ifex.then_clause().accept(this).</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.OrExpr orex)</code></p><p>visit or expression</p><h3>Parameters</h3><p><code>orex</code> - is the or expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AndExpr andex)</code></p><p>visit and expression</p><h3>Parameters</h3><p><code>andex</code> - is the and expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CmpExpr cmpex)</code></p><p>visit compare expression</p><h3>Parameters</h3><p><code>cmpex</code> - is the compare expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function or null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.RangeExpr rex)</code></p><p>visit range expression</p><h3>Parameters</h3><p><code>rex</code> - is the range expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AddExpr addex)</code></p><p>visit and expression</p><h3>Parameters</h3><p><code>addex</code> - is the and expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SubExpr subex)</code></p><p>visit sub expression</p><h3>Parameters</h3><p><code>subex</code> - is the sub expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.MulExpr mulex)</code></p><p>visit multiply expression</p><h3>Parameters</h3><p><code>mulex</code> - is the mul expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DivExpr mulex)</code></p><p>visit division expression</p><h3>Parameters</h3><p><code>mulex</code> - is the division expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IDivExpr mulex)</code></p><p>visit integer division expression</p><h3>Parameters</h3><p><code>mulex</code> - is the integer division expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ModExpr mulex)</code></p><p>visit modular expression</p><h3>Parameters</h3><p><code>mulex</code> - is the modular expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.UnionExpr unex)</code></p><p>visit union expression</p><h3>Parameters</h3><p><code>unex</code> - is the union expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.PipeExpr pipex)</code></p><p>visit pipe expression</p><h3>Parameters</h3><p><code>pipex</code> - is the pipe expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IntersectExpr iexpr)</code></p><p>visit intersect expression</p><h3>Parameters</h3><p><code>iexpr</code> - is the intersect expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ExceptExpr eexpr)</code></p><p>visit except expression</p><h3>Parameters</h3><p><code>eexpr</code> - is the except expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.InstOfExpr ioexp)</code></p><p>visit instance of expression</p><h3>Parameters</h3><p><code>ioexp</code> - is the instance of expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.TreatAsExpr taexp)</code></p><p>visit treat-as expression</p><h3>Parameters</h3><p><code>taexp</code> - is the treat-as expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CastableExpr cexp)</code></p><p>visit castable expression</p><h3>Parameters</h3><p><code>cexp</code> - is the castable expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr cexp)</code></p><p>visit cast expression</p><h3>Parameters</h3><p><code>cexp</code> - is the cast expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.MinusExpr e)</code></p><p>visit minus expression</p><h3>Parameters</h3><p><code>e</code> - is the minus expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.PlusExpr e)</code></p><p>visit plus expression</p><h3>Parameters</h3><p><code>e</code> - is the plus expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathExpr e)</code></p><p>visit XPath expression</p><h3>Parameters</h3><p><code>e</code> - is the XPath expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ForwardStep e)</code></p><p>visit a forward step expression</p><h3>Parameters</h3><p><code>e</code> - is the forward step.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ReverseStep e)</code></p><p>visit a reverse step expression</p><h3>Parameters</h3><p><code>e</code> - is the reverse step.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.NameTest e)</code></p><p>visit a name test expression</p><h3>Parameters</h3><p><code>e</code> - is thename test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.VarRef e)</code></p><p>visit variable reference</p><h3>Parameters</h3><p><code>e</code> - is the variable reference.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.StringLiteral e)</code></p><p>visit string literal.</p><h3>Parameters</h3><p><code>e</code> - is the string literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IntegerLiteral e)</code></p><p>visit integer literal.</p><h3>Parameters</h3><p><code>e</code> - is the integer literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DoubleLiteral e)</code></p><p>visit double literal.</p><h3>Parameters</h3><p><code>e</code> - is the double literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DecimalLiteral e)</code></p><p>visit decimal literal.</p><h3>Parameters</h3><p><code>e</code> - is the decimal literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ParExpr e)</code></p><p>visit parent expression.</p><h3>Parameters</h3><p><code>e</code> - is the parent expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CntxItemExpr e)</code></p><p>visit context item expression.</p><h3>Parameters</h3><p><code>e</code> - is the context item expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall e)</code></p><p>visit function call.</p><h3>Parameters</h3><p><code>e</code> - is the function call.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function or null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType e)</code></p><p>visit single type.</p><h3>Parameters</h3><p><code>e</code> - is the single type.</p><h3>Returns</h3><p><code>java.lang.Object</code> - null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType e)</code></p><p>visit sequence type.</p><h3>Parameters</h3><p><code>e</code> - is the sequence type.</p><h3>Returns</h3><p><code>java.lang.Object</code> - null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType e)</code></p><p>visit item type.</p><h3>Parameters</h3><p><code>e</code> - is the item type.</p><h3>Returns</h3><p><code>java.lang.Object</code> - null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest e)</code></p><p>visit any kind test.</p><h3>Parameters</h3><p><code>e</code> - is the any kind test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest e)</code></p><p>visit document test.</p><h3>Parameters</h3><p><code>e</code> - is the document test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest e)</code></p><p>visit text test.</p><h3>Parameters</h3><p><code>e</code> - is the text test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest e)</code></p><p>visit comment test.</p><h3>Parameters</h3><p><code>e</code> - is the text test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest e)</code></p><p>visit PI test.</p><h3>Parameters</h3><p><code>e</code> - is the PI test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a argument</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest e)</code></p><p>visit attribute test.</p><h3>Parameters</h3><p><code>e</code> - is the attribute test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest e)</code></p><p>visit schema attribute test.</p><h3>Parameters</h3><p><code>e</code> - is the schema attribute test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest e)</code></p><p>visit element test.</p><h3>Parameters</h3><p><code>e</code> - is the element test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest e)</code></p><p>visit schema element test.</p><h3>Parameters</h3><p><code>e</code> - is the schema element test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep e)</code></p><p>visit axis step.</p><h3>Parameters</h3><p><code>e</code> - is the axis step.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr e)</code></p><p>visit filter expression</p><h3>Parameters</h3><p><code>e</code> - is the filter expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_evaluate">evaluate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>evaluate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code></p><p>evaluate the xpath node</p><h3>Parameters</h3><p><code>node</code> - is the xpath node.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - result sequence.</p><hr><h2><a name="method_evaluate2">evaluate2</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>evaluate2</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr><h2><a name="method_focus">focus</a></h2><p><code>package-private org.eclipse.wst.xml.xpath2.processor.internal.Focus <strong>focus</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.Focus</code></p><hr><h2><a name="method_set_focus">set_focus</a></h2><p><code>package-private void <strong>set_focus</strong>(org.eclipse.wst.xml.xpath2.processor.internal.Focus f)</code></p><p></p><h3>Parameters</h3><p><code>f</code></p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.ast.XPath xp)</code></p><p>iterate through xpath expression</p><h3>Parameters</h3><p><code>xp</code> - is the xpath.</p><h3>Returns</h3><p><code>java.lang.Object</code> - result sequence.</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ForExpr fex)</code></p><p>visit for expression</p><h3>Parameters</h3><p><code>fex</code> - is the for expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function.</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.QuantifiedExpr qex)</code></p><p>visit quantified expression</p><h3>Parameters</h3><p><code>qex</code> - is the quantified expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function or null.</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IfExpr ifex)</code></p><p>visit if expression</p><h3>Parameters</h3><p><code>ifex</code> - is the if expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a ifex.then_clause().accept(this).</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.OrExpr orex)</code></p><p>visit or expression</p><h3>Parameters</h3><p><code>orex</code> - is the or expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AndExpr andex)</code></p><p>visit and expression</p><h3>Parameters</h3><p><code>andex</code> - is the and expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CmpExpr cmpex)</code></p><p>visit compare expression</p><h3>Parameters</h3><p><code>cmpex</code> - is the compare expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function or null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.RangeExpr rex)</code></p><p>visit range expression</p><h3>Parameters</h3><p><code>rex</code> - is the range expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AddExpr addex)</code></p><p>visit and expression</p><h3>Parameters</h3><p><code>addex</code> - is the and expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SubExpr subex)</code></p><p>visit sub expression</p><h3>Parameters</h3><p><code>subex</code> - is the sub expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.MulExpr mulex)</code></p><p>visit multiply expression</p><h3>Parameters</h3><p><code>mulex</code> - is the mul expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DivExpr mulex)</code></p><p>visit division expression</p><h3>Parameters</h3><p><code>mulex</code> - is the division expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IDivExpr mulex)</code></p><p>visit integer division expression</p><h3>Parameters</h3><p><code>mulex</code> - is the integer division expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ModExpr mulex)</code></p><p>visit modular expression</p><h3>Parameters</h3><p><code>mulex</code> - is the modular expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.UnionExpr unex)</code></p><p>visit union expression</p><h3>Parameters</h3><p><code>unex</code> - is the union expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.PipeExpr pipex)</code></p><p>visit pipe expression</p><h3>Parameters</h3><p><code>pipex</code> - is the pipe expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IntersectExpr iexpr)</code></p><p>visit intersect expression</p><h3>Parameters</h3><p><code>iexpr</code> - is the intersect expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ExceptExpr eexpr)</code></p><p>visit except expression</p><h3>Parameters</h3><p><code>eexpr</code> - is the except expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.InstOfExpr ioexp)</code></p><p>visit instance of expression</p><h3>Parameters</h3><p><code>ioexp</code> - is the instance of expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.TreatAsExpr taexp)</code></p><p>visit treat-as expression</p><h3>Parameters</h3><p><code>taexp</code> - is the treat-as expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CastableExpr cexp)</code></p><p>visit castable expression</p><h3>Parameters</h3><p><code>cexp</code> - is the castable expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr cexp)</code></p><p>visit cast expression</p><h3>Parameters</h3><p><code>cexp</code> - is the cast expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.MinusExpr e)</code></p><p>visit minus expression</p><h3>Parameters</h3><p><code>e</code> - is the minus expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.PlusExpr e)</code></p><p>visit plus expression</p><h3>Parameters</h3><p><code>e</code> - is the plus expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathExpr e)</code></p><p>visit XPath expression</p><h3>Parameters</h3><p><code>e</code> - is the XPath expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ForwardStep e)</code></p><p>visit a forward step expression</p><h3>Parameters</h3><p><code>e</code> - is the forward step.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ReverseStep e)</code></p><p>visit a reverse step expression</p><h3>Parameters</h3><p><code>e</code> - is the reverse step.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.NameTest e)</code></p><p>visit a name test expression</p><h3>Parameters</h3><p><code>e</code> - is thename test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.VarRef e)</code></p><p>visit variable reference</p><h3>Parameters</h3><p><code>e</code> - is the variable reference.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.StringLiteral e)</code></p><p>visit string literal.</p><h3>Parameters</h3><p><code>e</code> - is the string literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.IntegerLiteral e)</code></p><p>visit integer literal.</p><h3>Parameters</h3><p><code>e</code> - is the integer literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DoubleLiteral e)</code></p><p>visit double literal.</p><h3>Parameters</h3><p><code>e</code> - is the double literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DecimalLiteral e)</code></p><p>visit decimal literal.</p><h3>Parameters</h3><p><code>e</code> - is the decimal literal.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ParExpr e)</code></p><p>visit parent expression.</p><h3>Parameters</h3><p><code>e</code> - is the parent expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CntxItemExpr e)</code></p><p>visit context item expression.</p><h3>Parameters</h3><p><code>e</code> - is the context item expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall e)</code></p><p>visit function call.</p><h3>Parameters</h3><p><code>e</code> - is the function call.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function or null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType e)</code></p><p>visit single type.</p><h3>Parameters</h3><p><code>e</code> - is the single type.</p><h3>Returns</h3><p><code>java.lang.Object</code> - null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType e)</code></p><p>visit sequence type.</p><h3>Parameters</h3><p><code>e</code> - is the sequence type.</p><h3>Returns</h3><p><code>java.lang.Object</code> - null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType e)</code></p><p>visit item type.</p><h3>Parameters</h3><p><code>e</code> - is the item type.</p><h3>Returns</h3><p><code>java.lang.Object</code> - null</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest e)</code></p><p>visit any kind test.</p><h3>Parameters</h3><p><code>e</code> - is the any kind test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest e)</code></p><p>visit document test.</p><h3>Parameters</h3><p><code>e</code> - is the document test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest e)</code></p><p>visit text test.</p><h3>Parameters</h3><p><code>e</code> - is the text test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest e)</code></p><p>visit comment test.</p><h3>Parameters</h3><p><code>e</code> - is the text test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a new function</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest e)</code></p><p>visit PI test.</p><h3>Parameters</h3><p><code>e</code> - is the PI test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a argument</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest e)</code></p><p>visit attribute test.</p><h3>Parameters</h3><p><code>e</code> - is the attribute test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest e)</code></p><p>visit schema attribute test.</p><h3>Parameters</h3><p><code>e</code> - is the schema attribute test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest e)</code></p><p>visit element test.</p><h3>Parameters</h3><p><code>e</code> - is the element test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest e)</code></p><p>visit schema element test.</p><h3>Parameters</h3><p><code>e</code> - is the schema element test.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep e)</code></p><p>visit axis step.</p><h3>Parameters</h3><p><code>e</code> - is the axis step.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr><h2><a name="method_visit">visit</a></h2><p><code>public java.lang.Object <strong>visit</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr e)</code></p><p>visit filter expression</p><h3>Parameters</h3><p><code>e</code> - is the filter expression.</p><h3>Returns</h3><p><code>java.lang.Object</code> - a result sequence</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicContext.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicContext.html
index df5a6ab..31b4f4d 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicContext.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicContext.html
@@ -1,6 +1,6 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class DynamicContext</h2><br><hr><pre>public class <strong>DynamicContext</strong>
-extends </pre>Interface for dynamic context.<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  java.lang.String</code></td><td width="80%" align="left"><code><a href="#field_CODEPOINT_COLLATION">CODEPOINT_COLLATION</a></code><br>
+extends </pre>Interface for dynamic context.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  java.lang.String</code></td><td width="80%" align="left"><code><a href="#field_CODEPOINT_COLLATION">CODEPOINT_COLLATION</a></code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                The default collation which is guaranteed to always be implemented</td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_context_item">context_item</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -20,7 +20,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Return a useful collator for the specified URI</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_get_doc">get_doc</a>(java.net.URI uri)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Get document.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get_variable">get_variable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
+               Get document.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_get_variable">get_variable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Get variable.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_last">last</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -34,7 +34,11 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Set variable.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code></td><td width="" align="left"><code><a href="#method_tz">tz</a>()</code><br>
+               Set variable.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_set_variable">set_variable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+         ,
+      org.eclipse.wst.xml.xpath2.processor.ResultSequence val)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Sets a XPath2 sequence into a variable.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code></td><td width="" align="left"><code><a href="#method_tz">tz</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Reads the day from a TimeDuration type</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Field Detail
@@ -42,6 +46,8 @@
                   Methods Detail
                </h2></td></tr></table><h2><a name="method_context_item">context_item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>context_item</strong>()</code></p><p>Get context item.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - the context item.</p><hr><h2><a name="method_context_position">context_position</a></h2><p><code>public int <strong>context_position</strong>()</code></p><p>Get context node position.</p><h3>Returns</h3><p><code>int</code> - position of context node.</p><hr><h2><a name="method_current_date_time">current_date_time</a></h2><p><code>public java.util.GregorianCalendar <strong>current_date_time</strong>()</code></p><p>Returns the current date time using the GregorianCalendar.</p><h3>Returns</h3><p><code>java.util.GregorianCalendar</code> - The current date and time, which will always be same for the dynamic context.</p><hr><h2><a name="method_default_collation_name">default_collation_name</a></h2><p><code>public java.lang.String <strong>default_collation_name</strong>()</code></p><p>Returns the current default collator</p><h3>Returns</h3><p><code>java.lang.String</code> - The default name to use as the collator</p><hr><h2><a name="method_evaluate_function">evaluate_function</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>evaluate_function</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
          ,
-      java.util.Collection args)</code></p><p>Evaluate the function of the arguments.</p><h3>Parameters</h3><p><code>name</code> - is the name.</p><p><code>args</code> - are the arguments.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - result of the function evaluation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - dynamic error.</code></p><hr><h2><a name="method_focus">focus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.Focus <strong>focus</strong>()</code></p><p>Return focus.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.Focus</code> - Focus</p><hr><h2><a name="method_get_collation">get_collation</a></h2><p><code>public java.util.Comparator <strong>get_collation</strong>(java.lang.String uri)</code></p><p>Return a useful collator for the specified URI</p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>java.util.Comparator</code> - A Jaa collator, or null, if no such Collator exists</p><hr><h2><a name="method_get_doc">get_doc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>get_doc</strong>(java.net.URI uri)</code></p><p>Get document.</p><h3>Parameters</h3><p><code>uri</code> - is the URI of the document.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - document.</p><hr><h2><a name="method_get_variable">get_variable</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Get variable.</p><h3>Parameters</h3><p><code>name</code> - is the name of the variable.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - variable.</p><hr><h2><a name="method_last">last</a></h2><p><code>public int <strong>last</strong>()</code></p><p>Get position of last item.</p><h3>Returns</h3><p><code>int</code> - last item position.</p><hr><h2><a name="method_node_position">node_position</a></h2><p><code>public int <strong>node_position</strong>(org.w3c.dom.Node node)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_resolve_uri">resolve_uri</a></h2><p><code>public java.net.URI <strong>resolve_uri</strong>(java.lang.String uri)</code></p><p>Resolve an URI</p><h3>Parameters</h3><p><code>uri</code> - is the possibly relative URI to resolve</p><h3>Returns</h3><p><code>java.net.URI</code> - the absolutized, resolved URI.</p><hr><h2><a name="method_set_focus">set_focus</a></h2><p><code>public void <strong>set_focus</strong>(org.eclipse.wst.xml.xpath2.processor.internal.Focus focus)</code></p><p>Set focus.</p><h3>Parameters</h3><p><code>focus</code> - is focus to be set.</p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>public void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+      java.util.Collection args)</code></p><p>Evaluate the function of the arguments.</p><h3>Parameters</h3><p><code>name</code> - is the name.</p><p><code>args</code> - are the arguments.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - result of the function evaluation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - dynamic error.</code></p><hr><h2><a name="method_focus">focus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.Focus <strong>focus</strong>()</code></p><p>Return focus.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.Focus</code> - Focus</p><hr><h2><a name="method_get_collation">get_collation</a></h2><p><code>public java.util.Comparator <strong>get_collation</strong>(java.lang.String uri)</code></p><p>Return a useful collator for the specified URI</p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>java.util.Comparator</code> - A Jaa collator, or null, if no such Collator exists</p><hr><h2><a name="method_get_doc">get_doc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>get_doc</strong>(java.net.URI uri)</code></p><p>Get document.</p><h3>Parameters</h3><p><code>uri</code> - is the URI of the document.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - document.</p><hr><h2><a name="method_get_variable">get_variable</a></h2><p><code>public java.lang.Object <strong>get_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Get variable.</p><h3>Parameters</h3><p><code>name</code> - is the name of the variable.</p><h3>Returns</h3><p><code>java.lang.Object</code> - variable.</p><hr><h2><a name="method_last">last</a></h2><p><code>public int <strong>last</strong>()</code></p><p>Get position of last item.</p><h3>Returns</h3><p><code>int</code> - last item position.</p><hr><h2><a name="method_node_position">node_position</a></h2><p><code>public int <strong>node_position</strong>(org.w3c.dom.Node node)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_resolve_uri">resolve_uri</a></h2><p><code>public java.net.URI <strong>resolve_uri</strong>(java.lang.String uri)</code></p><p>Resolve an URI</p><h3>Parameters</h3><p><code>uri</code> - is the possibly relative URI to resolve</p><h3>Returns</h3><p><code>java.net.URI</code> - the absolutized, resolved URI.</p><hr><h2><a name="method_set_focus">set_focus</a></h2><p><code>public void <strong>set_focus</strong>(org.eclipse.wst.xml.xpath2.processor.internal.Focus focus)</code></p><p>Set focus.</p><h3>Parameters</h3><p><code>focus</code> - is focus to be set.</p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>public void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
          ,
-      org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code></p><p>Set variable.</p><h3>Parameters</h3><p><code>var</code> - is name of the variable.</p><p><code>val</code> - is the value to be set for the variable.</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Reads the day from a TimeDuration type</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - current date time and implicit timezone.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code></p><p>Set variable.</p><h3>Parameters</h3><p><code>var</code> - is name of the variable.</p><p><code>val</code> - is the value to be set for the variable.</p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>public void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+         ,
+      org.eclipse.wst.xml.xpath2.processor.ResultSequence val)</code></p><p>Sets a XPath2 sequence into a variable.</p><h3>Parameters</h3><p><code>var</code></p><p><code>val</code></p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Reads the day from a TimeDuration type</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - current date time and implicit timezone.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicError.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicError.html
index 66109c7..3ab231c 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicError.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicError.html
@@ -62,7 +62,11 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Returns the Dynamic Error for invalid flags in regular expressions</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.DynamicError</code></td><td width="" align="left"><code><a href="#method_regex_match_zero_length">regex_match_zero_length</a>(java.lang.String err)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the dynamic error.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.DynamicError</code></td><td width="" align="left"><code><a href="#method_throw_type_error">throw_type_error</a>()</code><br>
+               Returns the dynamic error.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.DynamicError</code></td><td width="" align="left"><code><a href="#method_runtime_error">runtime_error</a>(java.lang.String msg
+         ,
+      java.lang.Throwable err)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the dynamic error for an unsupported normalization form</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.DynamicError</code></td><td width="" align="left"><code><a href="#method_throw_type_error">throw_type_error</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Returns the dynamic error.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.DynamicError</code></td><td width="" align="left"><code><a href="#method_unsupported_codepoint">unsupported_codepoint</a>(java.lang.String err)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -84,7 +88,9 @@
          ,
       java.lang.String err)</code></p><p>Constructor for Dynamic Error.</p><hr><h2><a name="con_DynamicError">DynamicError</a></h2><p><code>public <strong>DynamicError</strong>(org.eclipse.wst.xml.xpath2.processor.internal.TypeError te)</code></p><p>Constructor for Dynamic Error.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_argument_type_error">argument_type_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>argument_type_error</strong>(java.lang.Class type)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>type</code> - Type found</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_cant_cast">cant_cast</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>cant_cast</strong>(java.lang.String err)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_code">code</a></h2><p><code>public java.lang.String <strong>code</strong>()</code></p><p>Returns the string of the code.</p><h3>Returns</h3><p><code>java.lang.String</code> - the code.</p><hr><h2><a name="method_contextUndefined">contextUndefined</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>contextUndefined</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div_zero">div_zero</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>div_zero</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads a Division by zero</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_doc_not_found">doc_not_found</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>doc_not_found</strong>(java.lang.String msg)</code></p><p>Returns the error message when fn:doc cannot load its document</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_empty_seq">empty_seq</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>empty_seq</strong>(java.lang.String msg)</code></p><p>Returns the error message</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_errorResolvingURI">errorResolvingURI</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>errorResolvingURI</strong>()</code></p><p>Error resolving relative uri against base-uri.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_inconsistentTimeZone">inconsistentTimeZone</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>inconsistentTimeZone</strong>()</code></p><p>The two arguments to fn:dateTime have inconsistent timezones</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_inputToLargeForDecimal">inputToLargeForDecimal</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>inputToLargeForDecimal</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalid_doc">invalid_doc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalid_doc</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads Invalid argument to fn:doc</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_invalidCollectionArgument">invalidCollectionArgument</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidCollectionArgument</strong>()</code></p><p>Returns the error message when reads Invalid argument to fn:collection</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_invalidForCastConstructor">invalidForCastConstructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidForCastConstructor</strong>()</code></p><p>Data is invalid for casting or the data type constructor.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - FORG0001</p><hr><h2><a name="method_invalidLexicalValue">invalidLexicalValue</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidLexicalValue</strong>()</code></p><p>Invalid lexical value</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalidPrefix">invalidPrefix</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidPrefix</strong>()</code></p><p>No namespace found for prefix.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalidTimezone">invalidTimezone</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidTimezone</strong>()</code></p><p>Invalid Timezone value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalidType">invalidType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lexical_error">lexical_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>lexical_error</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads an Invalid lexical value</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_more_one_item">more_one_item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>more_one_item</strong>(java.lang.String msg)</code></p><p>Returns the error message</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_nan">nan</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>nan</strong>()</code></p><p>Overflow/underflow in duration operation.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_noBaseURI">noBaseURI</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>noBaseURI</strong>()</code></p><p>No base-uri defined.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_noContextDoc">noContextDoc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>noContextDoc</strong>()</code></p><p>No context document</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_not_cmp">not_cmp</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>not_cmp</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads an Items not comparable</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_not_one">not_one</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>not_one</strong>(java.lang.String msg)</code></p><p>Returns the error message</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_numeric_overflow">numeric_overflow</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>numeric_overflow</strong>(java.lang.String msg)</code></p><p>Numeric operation overflow/underflow</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_overflowDateTime">overflowDateTime</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>overflowDateTime</strong>()</code></p><p>Overflow/underflow in date/time operation</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_overflowUnderflow">overflowUnderflow</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>overflowUnderflow</strong>()</code></p><p>Overflow/underflow in duration operation.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_regex_error">regex_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>regex_error</strong>(java.lang.String err)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_regex_flags_error">regex_flags_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>regex_flags_error</strong>(java.lang.String err)</code></p><p>Returns the Dynamic Error for invalid flags in regular expressions</p><h3>Parameters</h3><p><code>err</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_regex_match_zero_length">regex_match_zero_length</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>regex_match_zero_length</strong>(java.lang.String err)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_throw_type_error">throw_type_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>throw_type_error</strong>()</code></p><p>Returns the dynamic error.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - a Dynamic Error</code></p><hr><h2><a name="method_unsupported_codepoint">unsupported_codepoint</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>unsupported_codepoint</strong>(java.lang.String err)</code></p><p>Returns the dynamic error for an unsupported Unicode codepoint</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_unsupported_collation">unsupported_collation</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>unsupported_collation</strong>(java.lang.String collationName)</code></p><p>Returns the dynamic error for an unsupported normalization form</p><h3>Parameters</h3><p><code>collationName</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_unsupported_normalization_form">unsupported_normalization_form</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>unsupported_normalization_form</strong>(java.lang.String err)</code></p><p>Returns the dynamic error for an unsupported normalization form</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_user_error">user_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>user_error</strong>(java.lang.String ns
+               </h2></td></tr></table><h2><a name="method_argument_type_error">argument_type_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>argument_type_error</strong>(java.lang.Class type)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>type</code> - Type found</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_cant_cast">cant_cast</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>cant_cast</strong>(java.lang.String err)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_code">code</a></h2><p><code>public java.lang.String <strong>code</strong>()</code></p><p>Returns the string of the code.</p><h3>Returns</h3><p><code>java.lang.String</code> - the code.</p><hr><h2><a name="method_contextUndefined">contextUndefined</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>contextUndefined</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div_zero">div_zero</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>div_zero</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads a Division by zero</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_doc_not_found">doc_not_found</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>doc_not_found</strong>(java.lang.String msg)</code></p><p>Returns the error message when fn:doc cannot load its document</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_empty_seq">empty_seq</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>empty_seq</strong>(java.lang.String msg)</code></p><p>Returns the error message</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_errorResolvingURI">errorResolvingURI</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>errorResolvingURI</strong>()</code></p><p>Error resolving relative uri against base-uri.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_inconsistentTimeZone">inconsistentTimeZone</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>inconsistentTimeZone</strong>()</code></p><p>The two arguments to fn:dateTime have inconsistent timezones</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_inputToLargeForDecimal">inputToLargeForDecimal</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>inputToLargeForDecimal</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalid_doc">invalid_doc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalid_doc</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads Invalid argument to fn:doc</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_invalidCollectionArgument">invalidCollectionArgument</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidCollectionArgument</strong>()</code></p><p>Returns the error message when reads Invalid argument to fn:collection</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_invalidForCastConstructor">invalidForCastConstructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidForCastConstructor</strong>()</code></p><p>Data is invalid for casting or the data type constructor.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - FORG0001</p><hr><h2><a name="method_invalidLexicalValue">invalidLexicalValue</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidLexicalValue</strong>()</code></p><p>Invalid lexical value</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalidPrefix">invalidPrefix</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidPrefix</strong>()</code></p><p>No namespace found for prefix.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalidTimezone">invalidTimezone</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidTimezone</strong>()</code></p><p>Invalid Timezone value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_invalidType">invalidType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>invalidType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lexical_error">lexical_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>lexical_error</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads an Invalid lexical value</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_more_one_item">more_one_item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>more_one_item</strong>(java.lang.String msg)</code></p><p>Returns the error message</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_nan">nan</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>nan</strong>()</code></p><p>Overflow/underflow in duration operation.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_noBaseURI">noBaseURI</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>noBaseURI</strong>()</code></p><p>No base-uri defined.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_noContextDoc">noContextDoc</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>noContextDoc</strong>()</code></p><p>No context document</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_not_cmp">not_cmp</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>not_cmp</strong>(java.lang.String msg)</code></p><p>Returns the error message when reads an Items not comparable</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_not_one">not_one</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>not_one</strong>(java.lang.String msg)</code></p><p>Returns the error message</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_numeric_overflow">numeric_overflow</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>numeric_overflow</strong>(java.lang.String msg)</code></p><p>Numeric operation overflow/underflow</p><h3>Parameters</h3><p><code>msg</code> - is the message</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the make_error</p><hr><h2><a name="method_overflowDateTime">overflowDateTime</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>overflowDateTime</strong>()</code></p><p>Overflow/underflow in date/time operation</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_overflowUnderflow">overflowUnderflow</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>overflowUnderflow</strong>()</code></p><p>Overflow/underflow in duration operation.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_regex_error">regex_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>regex_error</strong>(java.lang.String err)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_regex_flags_error">regex_flags_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>regex_flags_error</strong>(java.lang.String err)</code></p><p>Returns the Dynamic Error for invalid flags in regular expressions</p><h3>Parameters</h3><p><code>err</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_regex_match_zero_length">regex_match_zero_length</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>regex_match_zero_length</strong>(java.lang.String err)</code></p><p>Returns the dynamic error.</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_runtime_error">runtime_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>runtime_error</strong>(java.lang.String msg
+         ,
+      java.lang.Throwable err)</code></p><p>Returns the dynamic error for an unsupported normalization form</p><h3>Parameters</h3><p><code>msg</code></p><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_throw_type_error">throw_type_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>throw_type_error</strong>()</code></p><p>Returns the dynamic error.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - a Dynamic Error</code></p><hr><h2><a name="method_unsupported_codepoint">unsupported_codepoint</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>unsupported_codepoint</strong>(java.lang.String err)</code></p><p>Returns the dynamic error for an unsupported Unicode codepoint</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_unsupported_collation">unsupported_collation</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>unsupported_collation</strong>(java.lang.String collationName)</code></p><p>Returns the dynamic error for an unsupported normalization form</p><h3>Parameters</h3><p><code>collationName</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_unsupported_normalization_form">unsupported_normalization_form</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>unsupported_normalization_form</strong>(java.lang.String err)</code></p><p>Returns the dynamic error for an unsupported normalization form</p><h3>Parameters</h3><p><code>err</code> - is the error</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code> - the DynamicError.</p><hr><h2><a name="method_user_error">user_error</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.DynamicError <strong>user_error</strong>(java.lang.String ns
          ,
       java.lang.String code
          ,
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.Engine.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.Engine.html
new file mode 100644
index 0000000..d9cffa2
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.Engine.html
@@ -0,0 +1,15 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
+               Class Engine</h2><br><hr><pre>public class <strong>Engine</strong>
+extends java.lang.Object</pre><p></p><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_Engine">Engine</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>package-private boolean</code></td><td width="" align="left"><code><a href="#method_effectiveBooleanValue">effectiveBooleanValue</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.XPath2Expression</code></td><td width="" align="left"><code><a href="#method_parseExpression">parseExpression</a>(java.lang.String expression
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext context)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_Engine">Engine</a></h2><p><code>public <strong>Engine</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_effectiveBooleanValue">effectiveBooleanValue</a></h2><p><code>package-private boolean <strong>effectiveBooleanValue</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_parseExpression">parseExpression</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.XPath2Expression <strong>parseExpression</strong>(java.lang.String expression
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext context)</code></p><p></p><h3>Parameters</h3><p><code>expression</code></p><p><code>context</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.XPath2Expression</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.JFlexCupParser.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.JFlexCupParser.html
index 7994a35..0373130 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.JFlexCupParser.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.JFlexCupParser.html
@@ -2,8 +2,14 @@
                Class JFlexCupParser</h2><br><hr><pre>public class <strong>JFlexCupParser</strong>
 extends java.lang.Object</pre>JFlexCupParser parses the xpath expression<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_JFlexCupParser">JFlexCupParser</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath</code></td><td width="" align="left"><code><a href="#method_parse">parse</a>(java.lang.String xpath)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
+               Tries to parse the xpath expression</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath</code></td><td width="" align="left"><code><a href="#method_parse">parse</a>(java.lang.String xpath
+         ,
+      boolean isRootlessAccess)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
                Tries to parse the xpath expression</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_JFlexCupParser">JFlexCupParser</a></h2><p><code>public <strong>JFlexCupParser</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_parse">parse</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath <strong>parse</strong>(java.lang.String xpath)</code></p><p>Tries to parse the xpath expression</p><h3>Parameters</h3><p><code>xpath</code> - is the xpath string.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ast.XPath</code> - the xpath value.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.XPathParserException</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_parse">parse</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath <strong>parse</strong>(java.lang.String xpath)</code></p><p>Tries to parse the xpath expression</p><h3>Parameters</h3><p><code>xpath</code> - is the xpath string.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ast.XPath</code> - the xpath value.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.XPathParserException</code></p><hr><h2><a name="method_parse">parse</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath <strong>parse</strong>(java.lang.String xpath
+         ,
+      boolean isRootlessAccess)</code></p><p>Tries to parse the xpath expression</p><h3>Parameters</h3><p><code>xpath</code> - is the xpath string.</p><p><code>isRootlessAccess</code> - if 'true' then PsychoPath engine can't parse xpath expressions starting with / or //.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ast.XPath</code> - the xpath value.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.XPathParserException</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.PsychoPathTypeHelper.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.PsychoPathTypeHelper.html
new file mode 100644
index 0000000..0567baa
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.PsychoPathTypeHelper.html
@@ -0,0 +1,16 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
+               Class PsychoPathTypeHelper</h2><br><hr><pre>public class <strong>PsychoPathTypeHelper</strong>
+extends java.lang.Object</pre>An PsychoPath Engine helper class providing useful module implementations for commonly 
+ performed "XML schema" evaluation tasks.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_DAYTIMEDURATION_DT">DAYTIMEDURATION_DT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  short</code></td><td width="80%" align="left"><code><a href="#field_YEARMONTHDURATION_DT">YEARMONTHDURATION_DT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_PsychoPathTypeHelper">PsychoPathTypeHelper</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static short</code></td><td width="" align="left"><code><a href="#method_getXSDTypeShortCode">getXSDTypeShortCode</a>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDef)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_DAYTIMEDURATION_DT">DAYTIMEDURATION_DT</a></h2><p><code>public static  short <strong>DAYTIMEDURATION_DT</strong></code></p><hr><h2><a name="field_YEARMONTHDURATION_DT">YEARMONTHDURATION_DT</a></h2><p><code>public static  short <strong>YEARMONTHDURATION_DT</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_PsychoPathTypeHelper">PsychoPathTypeHelper</a></h2><p><code>public <strong>PsychoPathTypeHelper</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getXSDTypeShortCode">getXSDTypeShortCode</a></h2><p><code>public short <strong>getXSDTypeShortCode</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDef)</code></p><p></p><h3>Parameters</h3><p><code>typeDef</code></p><h3>Returns</h3><p><code>short</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ResultSequence.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ResultSequence.html
index dd812a6..63896d4 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ResultSequence.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ResultSequence.html
@@ -1,6 +1,6 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class ResultSequence</h2><br><hr><pre>public class <strong>ResultSequence</strong>
-extends java.lang.Object</pre>Interface to the methods of range of result sequence<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ResultSequence">ResultSequence</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add">add</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code><br>
+extends java.lang.Object</pre>Interface to the methods of range of result sequence<p></p><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ResultSequence">ResultSequence</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add">add</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                add item</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_clear">clear</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -14,7 +14,11 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                retrieve the first item</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get">get</a>(int i)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               get item in index i</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.ListIterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               get item in index i</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_item">item</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_itemType">itemType</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.ListIterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                List Iterator.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_release">release</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -22,8 +26,10 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                get the size</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string">string</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               retrieve items in sequence</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               retrieve items in sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_value">value</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_ResultSequence">ResultSequence</a></h2><p><code>public <strong>ResultSequence</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_add">add</a></h2><p><code>public void <strong>add</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></p><p>add item</p><h3>Parameters</h3><p><code>item</code> - is an item of any type.</p><hr><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p>clear</p><hr><h2><a name="method_concat">concat</a></h2><p><code>public void <strong>concat</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p>concatinate from rs</p><h3>Parameters</h3><p><code>rs</code> - is a Result Sequence.</p><hr><h2><a name="method_create_new">create_new</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>create_new</strong>()</code></p><p>create a new result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - a new result sequence.</p><hr><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p>check is the sequence is empty</p><h3>Returns</h3><p><code>boolean</code> - boolean.</p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>first</strong>()</code></p><p>retrieve the first item</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - the first item.</p><hr><h2><a name="method_get">get</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get</strong>(int i)</code></p><p>get item in index i</p><h3>Parameters</h3><p><code>i</code> - is the position.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.ListIterator <strong>iterator</strong>()</code></p><p>List Iterator.</p><h3>Returns</h3><p><code>java.util.ListIterator</code></p><hr><h2><a name="method_release">release</a></h2><p><code>public void <strong>release</strong>()</code></p><p>release the result sequence</p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p>get the size</p><h3>Returns</h3><p><code>int</code> - the size.</p><hr><h2><a name="method_string">string</a></h2><p><code>public java.lang.String <strong>string</strong>()</code></p><p>retrieve items in sequence</p><h3>Returns</h3><p><code>java.lang.String</code> - result string</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_add">add</a></h2><p><code>public void <strong>add</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></p><p>add item</p><h3>Parameters</h3><p><code>item</code> - is an item of any type.</p><hr><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p>clear</p><hr><h2><a name="method_concat">concat</a></h2><p><code>public void <strong>concat</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p>concatinate from rs</p><h3>Parameters</h3><p><code>rs</code> - is a Result Sequence.</p><hr><h2><a name="method_create_new">create_new</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>create_new</strong>()</code></p><p>create a new result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - a new result sequence.</p><hr><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p>check is the sequence is empty</p><h3>Returns</h3><p><code>boolean</code> - boolean.</p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>first</strong>()</code></p><p>retrieve the first item</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - the first item.</p><hr><h2><a name="method_get">get</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get</strong>(int i)</code></p><p>get item in index i</p><h3>Parameters</h3><p><code>i</code> - is the position.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_item">item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>item</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_itemType">itemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>itemType</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.ListIterator <strong>iterator</strong>()</code></p><p>List Iterator.</p><h3>Returns</h3><p><code>java.util.ListIterator</code></p><hr><h2><a name="method_release">release</a></h2><p><code>public void <strong>release</strong>()</code></p><p>release the result sequence</p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p>get the size</p><h3>Returns</h3><p><code>int</code> - the size.</p><hr><h2><a name="method_string">string</a></h2><p><code>public java.lang.String <strong>string</strong>()</code></p><p>retrieve items in sequence</p><h3>Returns</h3><p><code>java.lang.String</code> - result string</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.Object <strong>value</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticContext.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticContext.html
index 6f1aa75..5ed5604 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticContext.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticContext.html
@@ -1,6 +1,6 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class StaticContext</h2><br><hr><pre>public class <strong>StaticContext</strong>
-extends </pre>interface to static context<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_function_library">add_function_library</a>(FunctionLibrary fl)</code><br>
+extends </pre>interface to static context<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_function_library">add_function_library</a>(FunctionLibrary fl)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                add function to library</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_namespace">add_namespace</a>(java.lang.String prefix
          ,
@@ -10,7 +10,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                add variable</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_attribute_declared">attribute_declared</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               is the attribute declared?</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.apache.xerces.xs.XSTypeDefinition</code></td><td width="" align="left"><code><a href="#method_attribute_type_definition">attribute_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code><br>
+               is the attribute declared?</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_attribute_type_definition">attribute_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI</code></td><td width="" align="left"><code><a href="#method_base_uri">base_uri</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -26,13 +26,13 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_derives_from">derives_from</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
          ,
-      org.apache.xerces.xs.XSTypeDefinition et)</code><br>
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition et)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_destroy_scope">destroy_scope</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                destroy scope</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_element_declared">element_declared</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               is the element declared?</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.apache.xerces.xs.XSTypeDefinition</code></td><td width="" align="left"><code><a href="#method_element_type_definition">element_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
+               is the element declared?</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_element_type_definition">element_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_expand_elem_type_qname">expand_elem_type_qname</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -46,7 +46,9 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                is the element declared?</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Map</code></td><td width="" align="left"><code><a href="#method_get_collections">get_collections</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></td><td width="" align="left"><code><a href="#method_make_atomic">make_atomic</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="" align="left"><code><a href="#method_getTypeModel">getTypeModel</a>(org.w3c.dom.Node element)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Gets the type provider in use for the specified DOM node.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></td><td width="" align="left"><code><a href="#method_make_atomic">make_atomic</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_new_scope">new_scope</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -70,10 +72,10 @@
                   Methods Detail
                </h2></td></tr></table><h2><a name="method_add_function_library">add_function_library</a></h2><p><code>public void <strong>add_function_library</strong>(FunctionLibrary fl)</code></p><p>add function to library</p><h3>Parameters</h3><p><code>fl</code> - is the function library</p><hr><h2><a name="method_add_namespace">add_namespace</a></h2><p><code>public void <strong>add_namespace</strong>(java.lang.String prefix
          ,
-      java.lang.String ns)</code></p><p>add namespace</p><h3>Parameters</h3><p><code>prefix</code> - the prefix of the namespace</p><p><code>ns</code> - is the XSTypeDefinition of the node</p><hr><h2><a name="method_add_variable">add_variable</a></h2><p><code>public void <strong>add_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>add variable</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><hr><h2><a name="method_attribute_declared">attribute_declared</a></h2><p><code>public boolean <strong>attribute_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code></p><p>is the attribute declared?</p><h3>Parameters</h3><p><code>attr</code> - is the attribute of the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_attribute_type_definition">attribute_type_definition</a></h2><p><code>public org.apache.xerces.xs.XSTypeDefinition <strong>attribute_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code></p><p></p><h3>Parameters</h3><p><code>attr</code> - is the qname variable</p><h3>Returns</h3><p><code>org.apache.xerces.xs.XSTypeDefinition</code> - attributes's type definition</p><hr><h2><a name="method_base_uri">base_uri</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI <strong>base_uri</strong>()</code></p><p>base uri</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI</code> - uri</p><hr><h2><a name="method_default_function_namespace">default_function_namespace</a></h2><p><code>public java.lang.String <strong>default_function_namespace</strong>()</code></p><p>the default function namespace</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_default_namespace">default_namespace</a></h2><p><code>public java.lang.String <strong>default_namespace</strong>()</code></p><p>the default namespace</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_del_variable">del_variable</a></h2><p><code>public boolean <strong>del_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>delete the variable</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if deleted variable</p><hr><h2><a name="method_derives_from">derives_from</a></h2><p><code>public boolean <strong>derives_from</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
+      java.lang.String ns)</code></p><p>add namespace</p><h3>Parameters</h3><p><code>prefix</code> - the prefix of the namespace</p><p><code>ns</code> - is the XSTypeDefinition of the node</p><hr><h2><a name="method_add_variable">add_variable</a></h2><p><code>public void <strong>add_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>add variable</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><hr><h2><a name="method_attribute_declared">attribute_declared</a></h2><p><code>public boolean <strong>attribute_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code></p><p>is the attribute declared?</p><h3>Parameters</h3><p><code>attr</code> - is the attribute of the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_attribute_type_definition">attribute_type_definition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>attribute_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code></p><p></p><h3>Parameters</h3><p><code>attr</code> - is the qname variable</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - attributes's type definition</p><hr><h2><a name="method_base_uri">base_uri</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI <strong>base_uri</strong>()</code></p><p>base uri</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI</code> - uri</p><hr><h2><a name="method_default_function_namespace">default_function_namespace</a></h2><p><code>public java.lang.String <strong>default_function_namespace</strong>()</code></p><p>the default function namespace</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_default_namespace">default_namespace</a></h2><p><code>public java.lang.String <strong>default_namespace</strong>()</code></p><p>the default namespace</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_del_variable">del_variable</a></h2><p><code>public boolean <strong>del_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>delete the variable</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if deleted variable</p><hr><h2><a name="method_derives_from">derives_from</a></h2><p><code>public boolean <strong>derives_from</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.QName et)</code></p><p></p><h3>Parameters</h3><p><code>at</code> - the node type</p><p><code>et</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_derives_from">derives_from</a></h2><p><code>public boolean <strong>derives_from</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
          ,
-      org.apache.xerces.xs.XSTypeDefinition et)</code></p><p></p><h3>Parameters</h3><p><code>at</code> - the node type</p><p><code>et</code> - is the XSTypeDefinition of the node</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_destroy_scope">destroy_scope</a></h2><p><code>public void <strong>destroy_scope</strong>()</code></p><p>destroy scope</p><hr><h2><a name="method_element_declared">element_declared</a></h2><p><code>public boolean <strong>element_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>is the element declared?</p><h3>Parameters</h3><p><code>elem</code> - is the elem of the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_element_type_definition">element_type_definition</a></h2><p><code>public org.apache.xerces.xs.XSTypeDefinition <strong>element_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p></p><h3>Parameters</h3><p><code>elem</code> - is the elem of the qname</p><h3>Returns</h3><p><code>org.apache.xerces.xs.XSTypeDefinition</code> - element's type definition</p><hr><h2><a name="method_expand_elem_type_qname">expand_elem_type_qname</a></h2><p><code>public boolean <strong>expand_elem_type_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>expand element type qname</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if function can be expanded</p><hr><h2><a name="method_expand_function_qname">expand_function_qname</a></h2><p><code>public boolean <strong>expand_function_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>expand function</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if function can be expanded</p><hr><h2><a name="method_expand_qname">expand_qname</a></h2><p><code>public boolean <strong>expand_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>expand qname</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if function can be expanded</p><hr><h2><a name="method_function_exists">function_exists</a></h2><p><code>public boolean <strong>function_exists</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition et)</code></p><p></p><h3>Parameters</h3><p><code>at</code> - the node type</p><p><code>et</code> - is the XSTypeDefinition of the node</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_destroy_scope">destroy_scope</a></h2><p><code>public void <strong>destroy_scope</strong>()</code></p><p>destroy scope</p><hr><h2><a name="method_element_declared">element_declared</a></h2><p><code>public boolean <strong>element_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>is the element declared?</p><h3>Parameters</h3><p><code>elem</code> - is the elem of the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_element_type_definition">element_type_definition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>element_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p></p><h3>Parameters</h3><p><code>elem</code> - is the elem of the qname</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - element's type definition</p><hr><h2><a name="method_expand_elem_type_qname">expand_elem_type_qname</a></h2><p><code>public boolean <strong>expand_elem_type_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>expand element type qname</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if function can be expanded</p><hr><h2><a name="method_expand_function_qname">expand_function_qname</a></h2><p><code>public boolean <strong>expand_function_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>expand function</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if function can be expanded</p><hr><h2><a name="method_expand_qname">expand_qname</a></h2><p><code>public boolean <strong>expand_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>expand qname</p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if function can be expanded</p><hr><h2><a name="method_function_exists">function_exists</a></h2><p><code>public boolean <strong>function_exists</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
          ,
-      int arity)</code></p><p>is the element declared?</p><h3>Parameters</h3><p><code>name</code> - is the qname name</p><p><code>arity</code> - integer of qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_get_collections">get_collections</a></h2><p><code>public java.util.Map <strong>get_collections</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_make_atomic">make_atomic</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>make_atomic</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code> - any atomic type</p><hr><h2><a name="method_new_scope">new_scope</a></h2><p><code>public void <strong>new_scope</strong>()</code></p><p>new scope</p><hr><h2><a name="method_prefix_exists">prefix_exists</a></h2><p><code>public boolean <strong>prefix_exists</strong>(java.lang.String prefix)</code></p><p>namespaces does the prefix exist</p><h3>Parameters</h3><p><code>prefix</code> - is the prefix</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_resolve_prefix">resolve_prefix</a></h2><p><code>public java.lang.String <strong>resolve_prefix</strong>(java.lang.String prefix)</code></p><p></p><h3>Parameters</h3><p><code>prefix</code> - is the prefix</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_set_base_uri">set_base_uri</a></h2><p><code>public void <strong>set_base_uri</strong>(java.lang.String baseuri)</code></p><p>Sets the base uri for the context.</p><h3>Parameters</h3><p><code>baseuri</code></p><hr><h2><a name="method_set_collections">set_collections</a></h2><p><code>public void <strong>set_collections</strong>(java.util.Map collections)</code></p><p></p><h3>Parameters</h3><p><code>collections</code></p><hr><h2><a name="method_type_defined">type_defined</a></h2><p><code>public boolean <strong>type_defined</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code> - is qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_variable_exists">variable_exists</a></h2><p><code>public boolean <strong>variable_exists</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if variable exists</p><hr><h2><a name="method_variable_in_scope">variable_in_scope</a></h2><p><code>public boolean <strong>variable_in_scope</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p></p><h3>Parameters</h3><p><code>var</code> - is the variable of qname</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_xpath1_compatible">xpath1_compatible</a></h2><p><code>public boolean <strong>xpath1_compatible</strong>()</code></p><p>is it xpath 1.0 compatible.</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr></body></html>
\ No newline at end of file
+      int arity)</code></p><p>is the element declared?</p><h3>Parameters</h3><p><code>name</code> - is the qname name</p><p><code>arity</code> - integer of qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_get_collections">get_collections</a></h2><p><code>public java.util.Map <strong>get_collections</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_getTypeModel">getTypeModel</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>getTypeModel</strong>(org.w3c.dom.Node element)</code></p><p>Gets the type provider in use for the specified DOM node.</p><h3>Parameters</h3><p><code>element</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></p><hr><h2><a name="method_make_atomic">make_atomic</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>make_atomic</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code> - any atomic type</p><hr><h2><a name="method_new_scope">new_scope</a></h2><p><code>public void <strong>new_scope</strong>()</code></p><p>new scope</p><hr><h2><a name="method_prefix_exists">prefix_exists</a></h2><p><code>public boolean <strong>prefix_exists</strong>(java.lang.String prefix)</code></p><p>namespaces does the prefix exist</p><h3>Parameters</h3><p><code>prefix</code> - is the prefix</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_resolve_prefix">resolve_prefix</a></h2><p><code>public java.lang.String <strong>resolve_prefix</strong>(java.lang.String prefix)</code></p><p></p><h3>Parameters</h3><p><code>prefix</code> - is the prefix</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_set_base_uri">set_base_uri</a></h2><p><code>public void <strong>set_base_uri</strong>(java.lang.String baseuri)</code></p><p>Sets the base uri for the context.</p><h3>Parameters</h3><p><code>baseuri</code></p><hr><h2><a name="method_set_collections">set_collections</a></h2><p><code>public void <strong>set_collections</strong>(java.util.Map collections)</code></p><p></p><h3>Parameters</h3><p><code>collections</code></p><hr><h2><a name="method_type_defined">type_defined</a></h2><p><code>public boolean <strong>type_defined</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code> - is qname</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_variable_exists">variable_exists</a></h2><p><code>public boolean <strong>variable_exists</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code> - is the qname</p><h3>Returns</h3><p><code>boolean</code> - boolean if variable exists</p><hr><h2><a name="method_variable_in_scope">variable_in_scope</a></h2><p><code>public boolean <strong>variable_in_scope</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p></p><h3>Parameters</h3><p><code>var</code> - is the variable of qname</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_xpath1_compatible">xpath1_compatible</a></h2><p><code>public boolean <strong>xpath1_compatible</strong>()</code></p><p>is it xpath 1.0 compatible.</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope.html
new file mode 100644
index 0000000..9285ed7
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope.html
@@ -0,0 +1,21 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
+               Class StaticNameResolver.VariableScope</h2><br><hr><pre>package-private class <strong>StaticNameResolver.VariableScope</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></td><td width="80%" align="left"><code><a href="#field_name">name</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope</code></td><td width="80%" align="left"><code><a href="#field_nextScope">nextScope</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="80%" align="left"><code><a href="#field_typeDef">typeDef</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_StaticNameResolver.VariableScope">StaticNameResolver.VariableScope</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.ItemType typeDef
+         ,
+      org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope nextScope)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong></code></p><hr><h2><a name="field_nextScope">nextScope</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope <strong>nextScope</strong></code></p><hr><h2><a name="field_typeDef">typeDef</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>typeDef</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_StaticNameResolver.VariableScope">StaticNameResolver.VariableScope</a></h2><p><code>public <strong>StaticNameResolver.VariableScope</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.ItemType typeDef
+         ,
+      org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope nextScope)</code></p><p></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.html
index 53b4530..a797f05 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.html
@@ -1,8 +1,20 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class StaticNameResolver</h2><br><hr><pre>public class <strong>StaticNameResolver</strong>
-extends java.lang.Object</pre>This class resolves static names.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_StaticNameResolver">StaticNameResolver</a></strong>(org.eclipse.wst.xml.xpath2.processor.StaticContext sc)</code></td></tr><tr><td><code><strong><a href="#con_StaticNameResolver.DummyError">StaticNameResolver.DummyError</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_check">check</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code><br>
+extends java.lang.Object</pre>This class resolves static names.<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_StaticNameResolver">StaticNameResolver</a></strong>(org.eclipse.wst.xml.xpath2.processor.StaticContext sc)</code></td></tr><tr><td><code><strong><a href="#con_StaticNameResolver">StaticNameResolver</a></strong>(org.eclipse.wst.xml.xpath2.api.StaticContext context)</code></td></tr><tr><td><code><strong><a href="#con_StaticNameResolver.DummyError">StaticNameResolver.DummyError</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_StaticNameResolver.VariableScope">StaticNameResolver.VariableScope</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.ItemType typeDef
+         ,
+      org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope nextScope)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_check">check</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Check the XPath node.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_printBinExpr">printBinExpr</a>(java.lang.String name
+               Check the XPath node.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Set</code></td><td width="" align="left"><code><a href="#method_getAxes">getAxes</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Set</code></td><td width="" align="left"><code><a href="#method_getFreeVariables">getFreeVariables</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Set</code></td><td width="" align="left"><code><a href="#method_getResolvedFunctions">getResolvedFunctions</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isRootUsed">isRootUsed</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_printBinExpr">printBinExpr</a>(java.lang.String name
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr e)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -112,9 +124,9 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Validate a filter expression.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_StaticNameResolver">StaticNameResolver</a></h2><p><code>public <strong>StaticNameResolver</strong>(org.eclipse.wst.xml.xpath2.processor.StaticContext sc)</code></p><p>Constructor for static name resolver</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_StaticNameResolver">StaticNameResolver</a></h2><p><code>public <strong>StaticNameResolver</strong>(org.eclipse.wst.xml.xpath2.processor.StaticContext sc)</code></p><p>Constructor for static name resolver</p><hr><h2><a name="con_StaticNameResolver">StaticNameResolver</a></h2><p><code>public <strong>StaticNameResolver</strong>(org.eclipse.wst.xml.xpath2.api.StaticContext context)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_check">check</a></h2><p><code>public void <strong>check</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code></p><p>Check the XPath node.</p><h3>Parameters</h3><p><code>node</code> - is the XPath node to check.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.StaticError - static error.</code></p><hr><h2><a name="method_printBinExpr">printBinExpr</a></h2><p><code>public void <strong>printBinExpr</strong>(java.lang.String name
+               </h2></td></tr></table><h2><a name="method_check">check</a></h2><p><code>public void <strong>check</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode node)</code></p><p>Check the XPath node.</p><h3>Parameters</h3><p><code>node</code> - is the XPath node to check.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.StaticError - static error.</code></p><hr><h2><a name="method_getAxes">getAxes</a></h2><p><code>public java.util.Set <strong>getAxes</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Set</code></p><hr><h2><a name="method_getFreeVariables">getFreeVariables</a></h2><p><code>public java.util.Set <strong>getFreeVariables</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Set</code></p><hr><h2><a name="method_getResolvedFunctions">getResolvedFunctions</a></h2><p><code>public java.util.Set <strong>getResolvedFunctions</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Set</code></p><hr><h2><a name="method_isRootUsed">isRootUsed</a></h2><p><code>public boolean <strong>isRootUsed</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_printBinExpr">printBinExpr</a></h2><p><code>public void <strong>printBinExpr</strong>(java.lang.String name
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr e)</code></p><p>Validate a binary expression by checking its left and right children.</p><h3>Parameters</h3><p><code>name</code> - is the name of the binary expression.</p><p><code>e</code> - is the expression itself.</p><hr><h2><a name="method_printUnExpr">printUnExpr</a></h2><p><code>public void <strong>printUnExpr</strong>(java.lang.String name
          ,
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathException.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathException.html
index c12ee7c..a3129f9 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathException.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathException.html
@@ -1,9 +1,11 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor</strong></font><br>
                Class XPathException</h2><br><hr><pre>public class <strong>XPathException</strong>
-extends java.lang.Exception</pre>This exception is thrown when there is a problem with an XPath exception.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XPathException">XPathException</a></strong>(java.lang.String reason)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_reason">reason</a>()</code><br>
+extends java.lang.RuntimeException</pre>This exception is thrown when there is a problem with an XPath exception.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XPathException">XPathException</a></strong>(java.lang.String reason)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getMessage">getMessage</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_reason">reason</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                The reason why the exception has been thrown.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XPathException">XPathException</a></h2><p><code>public <strong>XPathException</strong>(java.lang.String reason)</code></p><p>Constructor for XPathException</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_reason">reason</a></h2><p><code>public java.lang.String <strong>reason</strong>()</code></p><p>The reason why the exception has been thrown.</p><h3>Returns</h3><p><code>java.lang.String</code> - the reason why the exception has been throw.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_getMessage">getMessage</a></h2><p><code>public java.lang.String <strong>getMessage</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_reason">reason</a></h2><p><code>public java.lang.String <strong>reason</strong>()</code></p><p>The reason why the exception has been thrown.</p><h3>Returns</h3><p><code>java.lang.String</code> - the reason why the exception has been throw.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathParser.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathParser.html
index 651df74..5ce2dfa 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathParser.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.XPathParser.html
@@ -2,6 +2,12 @@
                Class XPathParser</h2><br><hr><pre>public class <strong>XPathParser</strong>
 extends </pre>This is an interface class for the XPath parser.<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath</code></td><td width="" align="left"><code><a href="#method_parse">parse</a>(java.lang.String xpath)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
+               Constructor for the XPath parser interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath</code></td><td width="" align="left"><code><a href="#method_parse">parse</a>(java.lang.String xpath
+         ,
+      boolean isRootlessAccess)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
                Constructor for the XPath parser interface.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_parse">parse</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath <strong>parse</strong>(java.lang.String xpath)</code></p><p>Constructor for the XPath parser interface.</p><h3>Parameters</h3><p><code>xpath</code> - is the input XPath to be parsed.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ast.XPath</code> - The parsed XPath.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.XPathParserException - XPath parser exception.</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_parse">parse</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath <strong>parse</strong>(java.lang.String xpath)</code></p><p>Constructor for the XPath parser interface.</p><h3>Parameters</h3><p><code>xpath</code> - is the input XPath to be parsed.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ast.XPath</code> - The parsed XPath.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.XPathParserException - XPath parser exception.</code></p><hr><h2><a name="method_parse">parse</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ast.XPath <strong>parse</strong>(java.lang.String xpath
+         ,
+      boolean isRootlessAccess)</code></p><p>Constructor for the XPath parser interface.</p><h3>Parameters</h3><p><code>xpath</code> - is the input XPath to be parsed.</p><p><code>isRootlessAccess</code> - if 'true' then PsychoPath engine can't parse xpath expressions starting with / or //.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ast.XPath</code> - The parsed XPath.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.XPathParserException - XPath parser exception.</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ast.XPath.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ast.XPath.html
index 35d815d..e46ae31 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ast.XPath.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.ast.XPath.html
@@ -1,11 +1,37 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.ast</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.ast</strong></font><br>
                Class XPath</h2><br><hr><pre>public class <strong>XPath</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode</pre>Support for XPath.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XPath">XPath</a></strong>(java.util.Collection exprs)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode</pre>Support for XPath.<p></p><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XPath">XPath</a></strong>(java.util.Collection exprs)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_evaluate">evaluate</a>(org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext
+         ,
+      java.lang.Object[] contextItems)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Iterator interface.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Collection</code></td><td width="" align="left"><code><a href="#method_getAxes">getAxes</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Collection</code></td><td width="" align="left"><code><a href="#method_getFreeVariables">getFreeVariables</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Collection</code></td><td width="" align="left"><code><a href="#method_getResolvedFunctions">getResolvedFunctions</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.StaticContext</code></td><td width="" align="left"><code><a href="#method_getStaticContext">getStaticContext</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isRootPathUsed">isRootPathUsed</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Support for Iterator interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_setAxes">setAxes</a>(java.util.Collection _axes)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_setFreeVariables">setFreeVariables</a>(java.util.Collection _freeVariables)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_setResolvedFunctions">setResolvedFunctions</a>(java.util.Collection _resolvedFunctions)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_setRootUsed">setRootUsed</a>(boolean _rootUsed)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_setStaticContext">setStaticContext</a>(org.eclipse.wst.xml.xpath2.api.StaticContext context)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XPath">XPath</a></h2><p><code>public <strong>XPath</strong>(java.util.Collection exprs)</code></p><p>Constructor for XPath.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p>Support for Iterator interface.</p><h3>Returns</h3><p><code>java.util.Iterator</code> - Result of Iterator operation.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_evaluate">evaluate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>evaluate</strong>(org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext
+         ,
+      java.lang.Object[] contextItems)</code></p><p></p><h3>Parameters</h3><p><code>dynamicContext</code></p><p><code>contextItems</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr><h2><a name="method_getAxes">getAxes</a></h2><p><code>public java.util.Collection <strong>getAxes</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Collection</code></p><hr><h2><a name="method_getFreeVariables">getFreeVariables</a></h2><p><code>public java.util.Collection <strong>getFreeVariables</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Collection</code></p><hr><h2><a name="method_getResolvedFunctions">getResolvedFunctions</a></h2><p><code>public java.util.Collection <strong>getResolvedFunctions</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Collection</code></p><hr><h2><a name="method_getStaticContext">getStaticContext</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.StaticContext <strong>getStaticContext</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.StaticContext</code></p><hr><h2><a name="method_isRootPathUsed">isRootPathUsed</a></h2><p><code>public boolean <strong>isRootPathUsed</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p>Support for Iterator interface.</p><h3>Returns</h3><p><code>java.util.Iterator</code> - Result of Iterator operation.</p><hr><h2><a name="method_setAxes">setAxes</a></h2><p><code>public void <strong>setAxes</strong>(java.util.Collection _axes)</code></p><p></p><h3>Parameters</h3><p><code>_axes</code></p><hr><h2><a name="method_setFreeVariables">setFreeVariables</a></h2><p><code>public void <strong>setFreeVariables</strong>(java.util.Collection _freeVariables)</code></p><p></p><h3>Parameters</h3><p><code>_freeVariables</code></p><hr><h2><a name="method_setResolvedFunctions">setResolvedFunctions</a></h2><p><code>public void <strong>setResolvedFunctions</strong>(java.util.Collection _resolvedFunctions)</code></p><p></p><h3>Parameters</h3><p><code>_resolvedFunctions</code></p><hr><h2><a name="method_setRootUsed">setRootUsed</a></h2><p><code>public void <strong>setRootUsed</strong>(boolean _rootUsed)</code></p><p></p><h3>Parameters</h3><p><code>_rootUsed</code></p><hr><h2><a name="method_setStaticContext">setStaticContext</a></h2><p><code>public void <strong>setStaticContext</strong>(org.eclipse.wst.xml.xpath2.api.StaticContext context)</code></p><p></p><h3>Parameters</h3><p><code>context</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorAxis.html
index 300271c..1bcc016 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorAxis.html
@@ -1,14 +1,20 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class AncestorAxis</h2><br><hr><pre>public class <strong>AncestorAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ParentAxis</pre>Returns the ancestors of the context node, this always includes the root
- node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AncestorAxis">AncestorAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AncestorAxis">AncestorAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Get the ancestors of the context node.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Get the ancestors of the context node.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_AncestorAxis">AncestorAxis</a></h2><p><code>public <strong>AncestorAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Get the ancestors of the context node.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The nodes that are ancestors of the context node.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Get the ancestors of the context node.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorOrSelfAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorOrSelfAxis.html
index 8915f33..ffaffd5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorOrSelfAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AncestorOrSelfAxis.html
@@ -1,14 +1,20 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class AncestorOrSelfAxis</h2><br><hr><pre>public class <strong>AncestorOrSelfAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis</pre>The ancestor-or-self axis contains the context node and the ancestors of the
- context node, this always includes the root node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AncestorOrSelfAxis">AncestorOrSelfAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ context node, this always includes the root node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AncestorOrSelfAxis">AncestorOrSelfAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Get ancestor nodes of the context node and the context node itself.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Get ancestor nodes of the context node and the context node itself.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_AncestorOrSelfAxis">AncestorOrSelfAxis</a></h2><p><code>public <strong>AncestorOrSelfAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Get ancestor nodes of the context node and the context node itself.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The context node and its ancestors.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Get ancestor nodes of the context node and the context node itself.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AttributeAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AttributeAxis.html
index 675796e..384f754 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AttributeAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.AttributeAxis.html
@@ -1,16 +1,22 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class AttributeAxis</h2><br><hr><pre>public class <strong>AttributeAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>The attribute axis contains the attributes of the context node. The axis will
- be empty unless the context node is an element.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AttributeAxis">AttributeAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ be empty unless the context node is an element.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AttributeAxis">AttributeAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the context node's attributes.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></td><td width="" align="left"><code><a href="#method_principal_node_kind">principal_node_kind</a>()</code><br>
+               Retrieves the context node's attributes.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></td><td width="" align="left"><code><a href="#method_principal_node_kind">principal_node_kind</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the node's principle node kind.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_AttributeAxis">AttributeAxis</a></h2><p><code>public <strong>AttributeAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Retrieves the context node's attributes.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The attibutes of the context node.</p><hr><h2><a name="method_principal_node_kind">principal_node_kind</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType <strong>principal_node_kind</strong>()</code></p><p>Retrieves the node's principle node kind.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code> - The type of node.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Retrieves the context node's attributes.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_principal_node_kind">principal_node_kind</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType <strong>principal_node_kind</strong>()</code></p><p>Retrieves the node's principle node kind.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code> - The type of node.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Axis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Axis.html
index 8aca1a6..528112a 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Axis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Axis.html
@@ -3,14 +3,20 @@
 extends </pre>This is the interface class for an Axis.
  
  An axis defines the "direction of movement" for a step between a context node
- and another node that is reachable via the axis.<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ and another node that is reachable via the axis.<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Get elements and attributes.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></td><td width="" align="left"><code><a href="#method_principal_node_kind">principal_node_kind</a>()</code><br>
+               Get elements and attributes.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the title of the sequence as it appears in the XPath source</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></td><td width="" align="left"><code><a href="#method_principal_node_kind">principal_node_kind</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Get the principle kind of node.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Get elements and attributes.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The result sequence.</p><hr><h2><a name="method_principal_node_kind">principal_node_kind</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType <strong>principal_node_kind</strong>()</code></p><p>Get the principle kind of node.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code> - The principle node kind.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Get elements and attributes.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>copyInto</code> - TODO</p><p><code>limitNode</code> - TODO</p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p>Returns the title of the sequence as it appears in the XPath source</p><h3>Returns</h3><p><code>java.lang.String</code> - Axis title</p><hr><h2><a name="method_principal_node_kind">principal_node_kind</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType <strong>principal_node_kind</strong>()</code></p><p>Get the principle kind of node.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code> - The principle node kind.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis.html
index 11e1c91..0850d67 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis.html
@@ -1,13 +1,29 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class ChildAxis</h2><br><hr><pre>public class <strong>ChildAxis</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>The child axis contains the children of the context node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ChildAxis">ChildAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>The child axis contains the children of the context node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ChildAxis">ChildAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected void</code></td><td width="" align="left"><code><a href="#method_addChildren">addChildren</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      boolean recurse)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the context node's children.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+         ,
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the context node's children.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_ChildAxis">ChildAxis</a></h2><p><code>public <strong>ChildAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_addChildren">addChildren</a></h2><p><code>protected void <strong>addChildren</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Retrieves the context node's children.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The context node's children.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      boolean recurse)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><p><code>copyInto</code></p><p><code>recurse</code></p><hr><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+         ,
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Retrieves the context node's children.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultResultSequence.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultResultSequence.html
index e66aa0e..2b16ca5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultResultSequence.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultResultSequence.html
@@ -1,6 +1,6 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class DefaultResultSequence</h2><br><hr><pre>public class <strong>DefaultResultSequence</strong>
-extends org.eclipse.wst.xml.xpath2.processor.ResultSequence</pre>Default implementation of a result sequence.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultResultSequence">DefaultResultSequence</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_DefaultResultSequence">DefaultResultSequence</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add">add</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.ResultSequence</pre>Default implementation of a result sequence.<p></p><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultResultSequence">DefaultResultSequence</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_DefaultResultSequence">DefaultResultSequence</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add">add</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_clear">clear</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -12,10 +12,14 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Whether or not array _seq is empty</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_first">first</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_firstValue">firstValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get">get</a>(int i)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.ListIterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_sequenceType">sequenceType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
@@ -24,4 +28,4 @@
  
  an empty array is created</p><hr><h2><a name="con_DefaultResultSequence">DefaultResultSequence</a></h2><p><code>public <strong>DefaultResultSequence</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_add">add</a></h2><p><code>public void <strong>add</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></p><p></p><h3>Parameters</h3><p><code>item</code> - is added to array _seq</p><hr><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p>Clears the sequence.</p><hr><h2><a name="method_concat">concat</a></h2><p><code>public void <strong>concat</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code> - ResultSequence</p><hr><h2><a name="method_create_new">create_new</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>create_new</strong>()</code></p><p>Create a new sequence.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The new sequence.</p><hr><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p>Whether or not array _seq is empty</p><h3>Returns</h3><p><code>boolean</code> - a boolean</p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - first item from array _seq</p><hr><h2><a name="method_get">get</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get</strong>(int i)</code></p><p></p><h3>Parameters</h3><p><code>i</code> - is the position of the array item that is wanted.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - item i from array _seq</p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.ListIterator <strong>iterator</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.ListIterator</code> - the next iteration of array _seq</p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code> - integer of the size of array _seq</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_add">add</a></h2><p><code>public void <strong>add</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></p><p></p><h3>Parameters</h3><p><code>item</code> - is added to array _seq</p><hr><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p>Clears the sequence.</p><hr><h2><a name="method_concat">concat</a></h2><p><code>public void <strong>concat</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code> - ResultSequence</p><hr><h2><a name="method_create_new">create_new</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>create_new</strong>()</code></p><p>Create a new sequence.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The new sequence.</p><hr><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p>Whether or not array _seq is empty</p><h3>Returns</h3><p><code>boolean</code> - a boolean</p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - first item from array _seq</p><hr><h2><a name="method_firstValue">firstValue</a></h2><p><code>public java.lang.Object <strong>firstValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code> - first item from array _seq</p><hr><h2><a name="method_get">get</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get</strong>(int i)</code></p><p></p><h3>Parameters</h3><p><code>i</code> - is the position of the array item that is wanted.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - item i from array _seq</p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.ListIterator <strong>iterator</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.ListIterator</code> - the next iteration of array _seq</p><hr><h2><a name="method_sequenceType">sequenceType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>sequenceType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code> - integer of the size of array _seq</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext.html
index 4f2609c..f3035c1 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext.html
@@ -1,7 +1,7 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class DefaultStaticContext</h2><br><hr><pre>public class <strong>DefaultStaticContext</strong>
 extends java.lang.Object</pre>Default implementation of a static context as described by the XPath 2.0
- specification.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultStaticContext">DefaultStaticContext</a></strong>(org.apache.xerces.xs.XSModel schema)</code></td></tr><tr><td><code><strong><a href="#con_DefaultStaticContext">DefaultStaticContext</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_function_library">add_function_library</a>(FunctionLibrary fl)</code><br>
+ specification.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DefaultStaticContext">DefaultStaticContext</a></strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel model)</code></td></tr><tr><td><code><strong><a href="#con_DefaultStaticContext">DefaultStaticContext</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_function_library">add_function_library</a>(FunctionLibrary fl)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Adds a function to the library.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_add_namespace">add_namespace</a>(java.lang.String prefix
          ,
@@ -13,7 +13,7 @@
  
  used for static checking.... i.e. presence of variables</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_attribute_declared">attribute_declared</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Checks if an attribute is in the in-scope schema definitions.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.apache.xerces.xs.XSTypeDefinition</code></td><td width="" align="left"><code><a href="#method_attribute_type_definition">attribute_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
+               Checks if an attribute is in the in-scope schema definitions.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_attribute_type_definition">attribute_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves type definition of the attribute in an element.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI</code></td><td width="" align="left"><code><a href="#method_base_uri">base_uri</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -31,13 +31,13 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Checks if an XML node derives from a specified type.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_derives_from">derives_from</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
          ,
-      org.apache.xerces.xs.XSTypeDefinition et)</code><br>
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition et)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Checks if an XML node derives from a specified type definition.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_destroy_scope">destroy_scope</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Destroys a scope.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_element_declared">element_declared</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               is element declared?</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.apache.xerces.xs.XSTypeDefinition</code></td><td width="" align="left"><code><a href="#method_element_type_definition">element_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
+               is element declared?</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_element_type_definition">element_type_definition</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Obtains schema definition of the type of an element.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_expand_elem_type_qname">expand_elem_type_qname</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -46,7 +46,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Expands a qname and uses the default function namespace if unprefixed.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_expand_qname">expand_qname</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Expands the qname's prefix into a namespace.</td></tr><tr valign="top"><td width="20%" align="right"><code>protected Function</code></td><td width="" align="left"><code><a href="#method_function">function</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+               Expands the qname's prefix into a namespace.</td></tr><tr valign="top"><td width="20%" align="right"><code>public Function</code></td><td width="" align="left"><code><a href="#method_function">function</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
          ,
       int arity)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -62,7 +62,11 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Map</code></td><td width="" align="left"><code><a href="#method_get_documents">get_documents</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get_var">get_var</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Map</code></td><td width="" align="left"><code><a href="#method_get_function_libraries">get_function_libraries</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected java.lang.Object</code></td><td width="" align="left"><code><a href="#method_get_var">get_var</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="" align="left"><code><a href="#method_getTypeModel">getTypeModel</a>(org.w3c.dom.Node node)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></td><td width="" align="left"><code><a href="#method_make_atomic">make_atomic</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -87,6 +91,10 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected void</code></td><td width="" align="left"><code><a href="#method_set_variable">set_variable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+         ,
+      org.eclipse.wst.xml.xpath2.processor.ResultSequence val)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_type_defined">type_defined</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName qname)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Checks whether the type is defined in the in scope schema definitions.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_type_defined">type_defined</a>(java.lang.String ns
@@ -101,24 +109,26 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                is it xpath1 compatible?</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_DefaultStaticContext">DefaultStaticContext</a></h2><p><code>public <strong>DefaultStaticContext</strong>(org.apache.xerces.xs.XSModel schema)</code></p><p>Constructor.</p><hr><h2><a name="con_DefaultStaticContext">DefaultStaticContext</a></h2><p><code>public <strong>DefaultStaticContext</strong>()</code></p><p>Constructor for schema-less documents.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_DefaultStaticContext">DefaultStaticContext</a></h2><p><code>public <strong>DefaultStaticContext</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel model)</code></p><p>Constructor.</p><hr><h2><a name="con_DefaultStaticContext">DefaultStaticContext</a></h2><p><code>public <strong>DefaultStaticContext</strong>()</code></p><p>Constructor for schema-less documents.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
                </h2></td></tr></table><h2><a name="method_add_function_library">add_function_library</a></h2><p><code>public void <strong>add_function_library</strong>(FunctionLibrary fl)</code></p><p>Adds a function to the library.</p><h3>Parameters</h3><p><code>fl</code> - Function library to add.</p><hr><h2><a name="method_add_namespace">add_namespace</a></h2><p><code>public void <strong>add_namespace</strong>(java.lang.String prefix
          ,
       java.lang.String namespace)</code></p><p>adds namespace</p><h3>Parameters</h3><p><code>prefix</code> - namespace prefix</p><p><code>namespace</code> - namespace URI</p><hr><h2><a name="method_add_variable">add_variable</a></h2><p><code>public void <strong>add_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p>Adds a variable to current scope.
  
- used for static checking.... i.e. presence of variables</p><h3>Parameters</h3><p><code>var</code> - variable name to add.</p><hr><h2><a name="method_attribute_declared">attribute_declared</a></h2><p><code>public boolean <strong>attribute_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code></p><p>Checks if an attribute is in the in-scope schema definitions.</p><h3>Parameters</h3><p><code>attr</code> - name of attribute.</p><h3>Returns</h3><p><code>boolean</code> - true if attribute is declared.</p><hr><h2><a name="method_attribute_type_definition">attribute_type_definition</a></h2><p><code>public org.apache.xerces.xs.XSTypeDefinition <strong>attribute_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>Retrieves type definition of the attribute in an element.</p><h3>Parameters</h3><p><code>elem</code> - element name</p><h3>Returns</h3><p><code>org.apache.xerces.xs.XSTypeDefinition</code> - schema definition of the type of the attribute</p><hr><h2><a name="method_base_uri">base_uri</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI <strong>base_uri</strong>()</code></p><p>return the base URI</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI</code> - XSAnyURI</p><hr><h2><a name="method_debug_print_vars">debug_print_vars</a></h2><p><code>public void <strong>debug_print_vars</strong>()</code></p><p>Debug function which will print current variable scopes and info.</p><hr><h2><a name="method_default_function_namespace">default_function_namespace</a></h2><p><code>public java.lang.String <strong>default_function_namespace</strong>()</code></p><p>Retrieves the defaul function namespace</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_default_namespace">default_namespace</a></h2><p><code>public java.lang.String <strong>default_namespace</strong>()</code></p><p>Retrieves the default namespace, when one is not allocated</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_del_variable">del_variable</a></h2><p><code>public boolean <strong>del_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p>Deletes a variable from current scope.</p><h3>Parameters</h3><p><code>var</code> - variable name to delete.</p><h3>Returns</h3><p><code>boolean</code> - false if variable doesn't exist.</p><hr><h2><a name="method_derives_from">derives_from</a></h2><p><code>public boolean <strong>derives_from</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
+ used for static checking.... i.e. presence of variables</p><h3>Parameters</h3><p><code>var</code> - variable name to add.</p><hr><h2><a name="method_attribute_declared">attribute_declared</a></h2><p><code>public boolean <strong>attribute_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName attr)</code></p><p>Checks if an attribute is in the in-scope schema definitions.</p><h3>Parameters</h3><p><code>attr</code> - name of attribute.</p><h3>Returns</h3><p><code>boolean</code> - true if attribute is declared.</p><hr><h2><a name="method_attribute_type_definition">attribute_type_definition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>attribute_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>Retrieves type definition of the attribute in an element.</p><h3>Parameters</h3><p><code>elem</code> - element name</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - schema definition of the type of the attribute</p><hr><h2><a name="method_base_uri">base_uri</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI <strong>base_uri</strong>()</code></p><p>return the base URI</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI</code> - XSAnyURI</p><hr><h2><a name="method_debug_print_vars">debug_print_vars</a></h2><p><code>public void <strong>debug_print_vars</strong>()</code></p><p>Debug function which will print current variable scopes and info.</p><hr><h2><a name="method_default_function_namespace">default_function_namespace</a></h2><p><code>public java.lang.String <strong>default_function_namespace</strong>()</code></p><p>Retrieves the defaul function namespace</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_default_namespace">default_namespace</a></h2><p><code>public java.lang.String <strong>default_namespace</strong>()</code></p><p>Retrieves the default namespace, when one is not allocated</p><h3>Returns</h3><p><code>java.lang.String</code> - string</p><hr><h2><a name="method_del_variable">del_variable</a></h2><p><code>public boolean <strong>del_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p>Deletes a variable from current scope.</p><h3>Parameters</h3><p><code>var</code> - variable name to delete.</p><h3>Returns</h3><p><code>boolean</code> - false if variable doesn't exist.</p><hr><h2><a name="method_derives_from">derives_from</a></h2><p><code>public boolean <strong>derives_from</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.QName et)</code></p><p>Checks if an XML node derives from a specified type.</p><h3>Parameters</h3><p><code>at</code> - node actual type</p><p><code>et</code> - name of expected type</p><h3>Returns</h3><p><code>boolean</code> - true if a derivation exists</p><hr><h2><a name="method_derives_from">derives_from</a></h2><p><code>public boolean <strong>derives_from</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType at
          ,
-      org.apache.xerces.xs.XSTypeDefinition et)</code></p><p>Checks if an XML node derives from a specified type definition.</p><h3>Parameters</h3><p><code>at</code> - node actual type.</p><p><code>et</code> - type definition of expected type.</p><h3>Returns</h3><p><code>boolean</code> - true if a derivation exists.</p><hr><h2><a name="method_destroy_scope">destroy_scope</a></h2><p><code>public void <strong>destroy_scope</strong>()</code></p><p>Destroys a scope.</p><hr><h2><a name="method_element_declared">element_declared</a></h2><p><code>public boolean <strong>element_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>is element declared?</p><h3>Parameters</h3><p><code>elem</code> - name of element.</p><h3>Returns</h3><p><code>boolean</code> - true if element declared.</p><hr><h2><a name="method_element_type_definition">element_type_definition</a></h2><p><code>public org.apache.xerces.xs.XSTypeDefinition <strong>element_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>Obtains schema definition of the type of an element.</p><h3>Parameters</h3><p><code>elem</code> - name of element who's type is desired.</p><h3>Returns</h3><p><code>org.apache.xerces.xs.XSTypeDefinition</code> - schema definition of type</p><hr><h2><a name="method_expand_elem_type_qname">expand_elem_type_qname</a></h2><p><code>public boolean <strong>expand_elem_type_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Expands a qname and uses the default type/element namespace if
- unprefixed.</p><h3>Parameters</h3><p><code>name</code> - qname to expand.</p><h3>Returns</h3><p><code>boolean</code> - true on success.</p><hr><h2><a name="method_expand_function_qname">expand_function_qname</a></h2><p><code>public boolean <strong>expand_function_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Expands a qname and uses the default function namespace if unprefixed.</p><h3>Parameters</h3><p><code>name</code> - qname to expand.</p><h3>Returns</h3><p><code>boolean</code> - true on success.</p><hr><h2><a name="method_expand_qname">expand_qname</a></h2><p><code>public boolean <strong>expand_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Expands the qname's prefix into a namespace.</p><h3>Parameters</h3><p><code>name</code> - qname to expand.</p><h3>Returns</h3><p><code>boolean</code> - true on success.</p><hr><h2><a name="method_function">function</a></h2><p><code>protected Function <strong>function</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition et)</code></p><p>Checks if an XML node derives from a specified type definition.</p><h3>Parameters</h3><p><code>at</code> - node actual type.</p><p><code>et</code> - type definition of expected type.</p><h3>Returns</h3><p><code>boolean</code> - true if a derivation exists.</p><hr><h2><a name="method_destroy_scope">destroy_scope</a></h2><p><code>public void <strong>destroy_scope</strong>()</code></p><p>Destroys a scope.</p><hr><h2><a name="method_element_declared">element_declared</a></h2><p><code>public boolean <strong>element_declared</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>is element declared?</p><h3>Parameters</h3><p><code>elem</code> - name of element.</p><h3>Returns</h3><p><code>boolean</code> - true if element declared.</p><hr><h2><a name="method_element_type_definition">element_type_definition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>element_type_definition</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName elem)</code></p><p>Obtains schema definition of the type of an element.</p><h3>Parameters</h3><p><code>elem</code> - name of element who's type is desired.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - schema definition of type</p><hr><h2><a name="method_expand_elem_type_qname">expand_elem_type_qname</a></h2><p><code>public boolean <strong>expand_elem_type_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Expands a qname and uses the default type/element namespace if
+ unprefixed.</p><h3>Parameters</h3><p><code>name</code> - qname to expand.</p><h3>Returns</h3><p><code>boolean</code> - true on success.</p><hr><h2><a name="method_expand_function_qname">expand_function_qname</a></h2><p><code>public boolean <strong>expand_function_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Expands a qname and uses the default function namespace if unprefixed.</p><h3>Parameters</h3><p><code>name</code> - qname to expand.</p><h3>Returns</h3><p><code>boolean</code> - true on success.</p><hr><h2><a name="method_expand_qname">expand_qname</a></h2><p><code>public boolean <strong>expand_qname</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Expands the qname's prefix into a namespace.</p><h3>Parameters</h3><p><code>name</code> - qname to expand.</p><h3>Returns</h3><p><code>boolean</code> - true on success.</p><hr><h2><a name="method_function">function</a></h2><p><code>public Function <strong>function</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
          ,
       int arity)</code></p><p></p><h3>Parameters</h3><p><code>name</code></p><p><code>arity</code></p><h3>Returns</h3><p><code>Function</code></p><hr><h2><a name="method_function_exists">function_exists</a></h2><p><code>public boolean <strong>function_exists</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
          ,
-      int arity)</code></p><p>Check for existance of function.</p><h3>Parameters</h3><p><code>name</code> - function name.</p><p><code>arity</code> - arity of function.</p><h3>Returns</h3><p><code>boolean</code> - true if function exists. False otherwise.</p><hr><h2><a name="method_get_cntxt_item_type">get_cntxt_item_type</a></h2><p><code>public java.lang.String <strong>get_cntxt_item_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_get_collections">get_collections</a></h2><p><code>public java.util.Map <strong>get_collections</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_get_default_collection_type">get_default_collection_type</a></h2><p><code>public java.lang.String <strong>get_default_collection_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_get_documents">get_documents</a></h2><p><code>public java.util.Map <strong>get_documents</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_get_var">get_var</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get_var</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p></p><h3>Parameters</h3><p><code>var</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_make_atomic">make_atomic</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>make_atomic</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Creates an atomic from a specific type name initialized with a default
+      int arity)</code></p><p>Check for existance of function.</p><h3>Parameters</h3><p><code>name</code> - function name.</p><p><code>arity</code> - arity of function.</p><h3>Returns</h3><p><code>boolean</code> - true if function exists. False otherwise.</p><hr><h2><a name="method_get_cntxt_item_type">get_cntxt_item_type</a></h2><p><code>public java.lang.String <strong>get_cntxt_item_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_get_collections">get_collections</a></h2><p><code>public java.util.Map <strong>get_collections</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_get_default_collection_type">get_default_collection_type</a></h2><p><code>public java.lang.String <strong>get_default_collection_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_get_documents">get_documents</a></h2><p><code>public java.util.Map <strong>get_documents</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_get_function_libraries">get_function_libraries</a></h2><p><code>public java.util.Map <strong>get_function_libraries</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_get_var">get_var</a></h2><p><code>protected java.lang.Object <strong>get_var</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p></p><h3>Parameters</h3><p><code>var</code></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeModel">getTypeModel</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>getTypeModel</strong>(org.w3c.dom.Node node)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></p><hr><h2><a name="method_make_atomic">make_atomic</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>make_atomic</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)</code></p><p>Creates an atomic from a specific type name initialized with a default
  value.</p><h3>Parameters</h3><p><code>name</code> - name of type to create</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code> - Atomic type of desired type.</p><hr><h2><a name="method_new_scope">new_scope</a></h2><p><code>public void <strong>new_scope</strong>()</code></p><p>Creates a new scope level.</p><hr><h2><a name="method_prefix_exists">prefix_exists</a></h2><p><code>public boolean <strong>prefix_exists</strong>(java.lang.String pref)</code></p><p>does prefix exist?</p><h3>Parameters</h3><p><code>pref</code> - prefix name.</p><h3>Returns</h3><p><code>boolean</code> - true if it does.</p><hr><h2><a name="method_resolve_prefix">resolve_prefix</a></h2><p><code>public java.lang.String <strong>resolve_prefix</strong>(java.lang.String pref)</code></p><p>Resolves a prefix into a namespace URI.</p><h3>Parameters</h3><p><code>pref</code> - prefix name</p><h3>Returns</h3><p><code>java.lang.String</code> - uri prefix is resolved to or null.</p><hr><h2><a name="method_set_base_uri">set_base_uri</a></h2><p><code>public void <strong>set_base_uri</strong>(java.lang.String baseuri)</code></p><p>Set the Base URI for the static context.</p><h3>Parameters</h3><p><code>baseuri</code></p><hr><h2><a name="method_set_cntxt_item_type">set_cntxt_item_type</a></h2><p><code>public void <strong>set_cntxt_item_type</strong>(java.lang.String cntxtItemType)</code></p><p></p><h3>Parameters</h3><p><code>cntxtItemType</code></p><hr><h2><a name="method_set_collections">set_collections</a></h2><p><code>public void <strong>set_collections</strong>(java.util.Map collections)</code></p><p></p><h3>Parameters</h3><p><code>collections</code></p><hr><h2><a name="method_set_default_collection_type">set_default_collection_type</a></h2><p><code>public void <strong>set_default_collection_type</strong>(java.lang.String defaultCollectionType)</code></p><p></p><h3>Parameters</h3><p><code>defaultCollectionType</code></p><hr><h2><a name="method_set_documents">set_documents</a></h2><p><code>public void <strong>set_documents</strong>(java.util.Map _documents)</code></p><p></p><h3>Parameters</h3><p><code>_documents</code></p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>protected void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
          ,
-      org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code></p><p></p><h3>Parameters</h3><p><code>var</code></p><p><code>val</code></p><hr><h2><a name="method_type_defined">type_defined</a></h2><p><code>public boolean <strong>type_defined</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName qname)</code></p><p>Checks whether the type is defined in the in scope schema definitions.</p><h3>Parameters</h3><p><code>qname</code> - type name.</p><h3>Returns</h3><p><code>boolean</code> - true if type is defined.</p><hr><h2><a name="method_type_defined">type_defined</a></h2><p><code>public boolean <strong>type_defined</strong>(java.lang.String ns
+      org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)</code></p><p></p><h3>Parameters</h3><p><code>var</code></p><p><code>val</code></p><hr><h2><a name="method_set_variable">set_variable</a></h2><p><code>protected void <strong>set_variable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var
+         ,
+      org.eclipse.wst.xml.xpath2.processor.ResultSequence val)</code></p><p></p><h3>Parameters</h3><p><code>var</code></p><p><code>val</code></p><hr><h2><a name="method_type_defined">type_defined</a></h2><p><code>public boolean <strong>type_defined</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName qname)</code></p><p>Checks whether the type is defined in the in scope schema definitions.</p><h3>Parameters</h3><p><code>qname</code> - type name.</p><h3>Returns</h3><p><code>boolean</code> - true if type is defined.</p><hr><h2><a name="method_type_defined">type_defined</a></h2><p><code>public boolean <strong>type_defined</strong>(java.lang.String ns
          ,
       java.lang.String type)</code></p><p>Checks whether the type is defined in the in scope schema definitions.</p><h3>Parameters</h3><p><code>ns</code> - namespace of type.</p><p><code>type</code> - name of type.</p><h3>Returns</h3><p><code>boolean</code> - true if type is defined.</p><hr><h2><a name="method_variable_exists">variable_exists</a></h2><p><code>public boolean <strong>variable_exists</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p>does variable exist in current scope ?</p><h3>Parameters</h3><p><code>var</code> - variable name.</p><h3>Returns</h3><p><code>boolean</code> - true if it does.</p><hr><h2><a name="method_variable_in_scope">variable_in_scope</a></h2><p><code>public boolean <strong>variable_in_scope</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var)</code></p><p>checks to see if variable is in scope</p><h3>Parameters</h3><p><code>var</code> - variable name.</p><h3>Returns</h3><p><code>boolean</code> - true if variable is in current or above scope.</p><hr><h2><a name="method_xpath1_compatible">xpath1_compatible</a></h2><p><code>public boolean <strong>xpath1_compatible</strong>()</code></p><p>is it xpath1 compatible?</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis.html
index ba112eb..9035c1b 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis.html
@@ -1,13 +1,19 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class DescendantAxis</h2><br><hr><pre>public class <strong>DescendantAxis</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis</pre>The descendant axis contains the descendants of the context node<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DescendantAxis">DescendantAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+extends org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis</pre>The descendant axis contains the descendants of the context node<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DescendantAxis">DescendantAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Using the context node retrieve the descendants of this node</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Using the context node retrieve the descendants of this node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_DescendantAxis">DescendantAxis</a></h2><p><code>public <strong>DescendantAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Using the context node retrieve the descendants of this node</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The descendants of the context node.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Using the context node retrieve the descendants of this node</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis.html
index de299f4..6d0553e 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis.html
@@ -1,16 +1,22 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class DescendantOrSelfAxis</h2><br><hr><pre>public class <strong>DescendantOrSelfAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>The descendant-or-self axis contains the context node and the descendants of
- the context node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DescendantOrSelfAxis">DescendantOrSelfAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ the context node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DescendantOrSelfAxis">DescendantOrSelfAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer rs
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieve the the descendants of the context node and the context node
- itself.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+ itself.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_DescendantOrSelfAxis">DescendantOrSelfAxis</a></h2><p><code>public <strong>DescendantOrSelfAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Retrieve the the descendants of the context node and the context node
- itself.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The context node and its descendants.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer rs
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Retrieve the the descendants of the context node and the context node
+ itself.</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>rs</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DynamicContextAdapter.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DynamicContextAdapter.html
new file mode 100644
index 0000000..3697a95
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DynamicContextAdapter.html
@@ -0,0 +1,25 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
+               Class DynamicContextAdapter</h2><br><hr><pre>public class <strong>DynamicContextAdapter</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DynamicContextAdapter">DynamicContextAdapter</a></strong>(org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider</code></td><td width="" align="left"><code><a href="#method_getCollationProvider">getCollationProvider</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Map</code></td><td width="" align="left"><code><a href="#method_getCollections">getCollections</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.GregorianCalendar</code></td><td width="" align="left"><code><a href="#method_getCurrentDateTime">getCurrentDateTime</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getDefaultCollection">getDefaultCollection</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.Document</code></td><td width="" align="left"><code><a href="#method_getDocument">getDocument</a>(java.net.URI uri)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.Node</code></td><td width="" align="left"><code><a href="#method_getLimitNode">getLimitNode</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public javax.xml.datatype.Duration</code></td><td width="" align="left"><code><a href="#method_getTimezoneOffset">getTimezoneOffset</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_getVariable">getVariable</a>(javax.xml.namespace.QName name)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.net.URI</code></td><td width="" align="left"><code><a href="#method_resolveUri">resolveUri</a>(java.lang.String uri)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_DynamicContextAdapter">DynamicContextAdapter</a></h2><p><code>public <strong>DynamicContextAdapter</strong>(org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getCollationProvider">getCollationProvider</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider <strong>getCollationProvider</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.CollationProvider</code></p><hr><h2><a name="method_getCollections">getCollections</a></h2><p><code>public java.util.Map <strong>getCollections</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_getCurrentDateTime">getCurrentDateTime</a></h2><p><code>public java.util.GregorianCalendar <strong>getCurrentDateTime</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.GregorianCalendar</code></p><hr><h2><a name="method_getDefaultCollection">getDefaultCollection</a></h2><p><code>public java.util.List <strong>getDefaultCollection</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.List</code></p><hr><h2><a name="method_getDocument">getDocument</a></h2><p><code>public org.w3c.dom.Document <strong>getDocument</strong>(java.net.URI uri)</code></p><p></p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>org.w3c.dom.Document</code></p><hr><h2><a name="method_getLimitNode">getLimitNode</a></h2><p><code>public org.w3c.dom.Node <strong>getLimitNode</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.w3c.dom.Node</code></p><hr><h2><a name="method_getTimezoneOffset">getTimezoneOffset</a></h2><p><code>public javax.xml.datatype.Duration <strong>getTimezoneOffset</strong>()</code></p><p></p><h3>Returns</h3><p><code>javax.xml.datatype.Duration</code></p><hr><h2><a name="method_getVariable">getVariable</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>getVariable</strong>(javax.xml.namespace.QName name)</code></p><p></p><h3>Parameters</h3><p><code>name</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr><h2><a name="method_resolveUri">resolveUri</a></h2><p><code>public java.net.URI <strong>resolveUri</strong>(java.lang.String uri)</code></p><p></p><h3>Parameters</h3><p><code>uri</code></p><h3>Returns</h3><p><code>java.net.URI</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Focus.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Focus.html
index 6b3fc6d..30e9f0b 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Focus.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Focus.html
@@ -1,6 +1,6 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class Focus</h2><br><hr><pre>public class <strong>Focus</strong>
-extends java.lang.Object</pre>set the focus from a result sequence<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_Focus">Focus</a></strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_advance_cp">advance_cp</a>()</code><br>
+extends java.lang.Object</pre>set the focus from a result sequence<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_Focus">Focus</a></strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_advance_cp">advance_cp</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Checks to see if possible to advance rs.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_context_item">context_item</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -12,6 +12,6 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                sets the position.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_Focus">Focus</a></h2><p><code>public <strong>Focus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p>Sets the _rs to rs and context position to 1.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_Focus">Focus</a></h2><p><code>public <strong>Focus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p>Sets the _rs to rs and context position to 1.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
                </h2></td></tr></table><h2><a name="method_advance_cp">advance_cp</a></h2><p><code>public boolean <strong>advance_cp</strong>()</code></p><p>Checks to see if possible to advance rs.</p><h3>Returns</h3><p><code>boolean</code> - the boolean.</p><hr><h2><a name="method_context_item">context_item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>context_item</strong>()</code></p><p>Retrieves previous item from current context position.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - the item from _rs, or null if there is no context item.</p><hr><h2><a name="method_last">last</a></h2><p><code>public int <strong>last</strong>()</code></p><p>returns the position of the last item in rs.</p><h3>Returns</h3><p><code>int</code> - the size of rs.</p><hr><h2><a name="method_position">position</a></h2><p><code>public int <strong>position</strong>()</code></p><p>returns an integer of the current position.</p><h3>Returns</h3><p><code>int</code> - the current position of rs.</p><hr><h2><a name="method_set_position">set_position</a></h2><p><code>public void <strong>set_position</strong>(int p)</code></p><p>sets the position.</p><h3>Parameters</h3><p><code>p</code> - is the position that is set.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingAxis.html
index 7e96d61..1eb781b 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingAxis.html
@@ -2,14 +2,20 @@
                Class FollowingAxis</h2><br><hr><pre>public class <strong>FollowingAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>the following axis contains the context node's following siblings, those
  children of the context node's parent that occur after the context node in
- document order.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_FollowingAxis">FollowingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ document order.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_FollowingAxis">FollowingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer result
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Return the result of FollowingAxis expression</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Return the result of FollowingAxis expression</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_FollowingAxis">FollowingAxis</a></h2><p><code>public <strong>FollowingAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Return the result of FollowingAxis expression</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The result of FollowingAxis.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer result
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Return the result of FollowingAxis expression</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>result</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis.html
index 4d65894..cf53019 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis.html
@@ -3,14 +3,20 @@
 extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>The following-sibling axis contains the context node's following siblings,
  those children of the context node's parent that occur after the context node
  in document order; if the context node is an attribute nodeor namespace node,
- the following-sibling axis is empty.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_FollowingSiblingAxis">FollowingSiblingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ the following-sibling axis is empty.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_FollowingSiblingAxis">FollowingSiblingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Return the result of FollowingSiblingAxis expression</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Return the result of FollowingSiblingAxis expression</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_FollowingSiblingAxis">FollowingSiblingAxis</a></h2><p><code>public <strong>FollowingSiblingAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>Return the result of FollowingSiblingAxis expression</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>dc</code> - is the dynamic context.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The result of FollowingSiblingAxis.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>Return the result of FollowingSiblingAxis expression</p><h3>Parameters</h3><p><code>node</code> - is the type of node.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ParentAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ParentAxis.html
index 4c92d34..35db978 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ParentAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ParentAxis.html
@@ -2,14 +2,22 @@
                Class ParentAxis</h2><br><hr><pre>public class <strong>ParentAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis</pre>the parent axis contains the sequence returned by the dm:parent accessor in,
  which returns the parent of the context node, or an empty sequence if the
- context node has no parent<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ParentAxis">ParentAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
-         ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+ context node has no parent<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ParentAxis">ParentAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.Node</code></td><td width="" align="left"><code><a href="#method_findParent">findParent</a>(org.w3c.dom.Node n)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               returns parent accessors of the context node</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+         ,
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               returns parent accessors of the context node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_ParentAxis">ParentAxis</a></h2><p><code>public <strong>ParentAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_findParent">findParent</a></h2><p><code>public org.w3c.dom.Node <strong>findParent</strong>(org.w3c.dom.Node n)</code></p><p></p><h3>Parameters</h3><p><code>n</code></p><h3>Returns</h3><p><code>org.w3c.dom.Node</code></p><hr><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>returns parent accessors of the context node</p><h3>Parameters</h3><p><code>node</code> - is the node type.</p><p><code>dc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - the accessors.</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>returns parent accessors of the context node</p><h3>Parameters</h3><p><code>node</code> - is the node type.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingAxis.html
index 5fbeeab..f830f6e 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingAxis.html
@@ -1,14 +1,20 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class PrecedingAxis</h2><br><hr><pre>public class <strong>PrecedingAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis</pre>the preceding axis contains all nodes that are descendants of the root of the
- tree in which the context node is found<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_PrecedingAxis">PrecedingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ tree in which the context node is found<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_PrecedingAxis">PrecedingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer result
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               returns preceding nodes of the context node</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               returns preceding nodes of the context node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_PrecedingAxis">PrecedingAxis</a></h2><p><code>public <strong>PrecedingAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>returns preceding nodes of the context node</p><h3>Parameters</h3><p><code>node</code> - is the node type.</p><p><code>dc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - the descendants of the context node</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer result
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>returns preceding nodes of the context node</p><h3>Parameters</h3><p><code>node</code> - is the node type.</p><p><code>result</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingSiblingAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingSiblingAxis.html
index d686549..60203f3 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingSiblingAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.PrecedingSiblingAxis.html
@@ -1,14 +1,20 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class PrecedingSiblingAxis</h2><br><hr><pre>public class <strong>PrecedingSiblingAxis</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis</pre>the preceding axis contains all nodes that are descendants of the root of the
- tree in which the context node is found including the context node itself<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_PrecedingSiblingAxis">PrecedingSiblingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+ tree in which the context node is found including the context node itself<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_PrecedingSiblingAxis">PrecedingSiblingAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               returns preceding nodes of the context node</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               returns preceding nodes of the context node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_PrecedingSiblingAxis">PrecedingSiblingAxis</a></h2><p><code>public <strong>PrecedingSiblingAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>returns preceding nodes of the context node</p><h3>Parameters</h3><p><code>node</code> - is the node type.</p><p><code>dc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - the descendants and the context node</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>returns preceding nodes of the context node</p><h3>Parameters</h3><p><code>node</code> - is the node type.</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.RangeResultSequence.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.RangeResultSequence.html
index d6de6b0..75ef295 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.RangeResultSequence.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.RangeResultSequence.html
@@ -15,13 +15,17 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                asks if the range is empty?</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_first">first</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_firstValue">firstValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get">get</a>(int i)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.ListIterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                interate through range.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_release">release</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               release</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
+               release</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_sequenceType">sequenceType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
@@ -29,4 +33,4 @@
          ,
       int end)</code></p><p>set the start and end of the range result sequence</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_add">add</a></h2><p><code>public void <strong>add</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></p><p>item is an integer to add to the range.</p><h3>Parameters</h3><p><code>item</code> - is an integer.</p><hr><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p>clear range</p><hr><h2><a name="method_concat">concat</a></h2><p><code>public void <strong>concat</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p>remove the tail from the range given.</p><h3>Parameters</h3><p><code>rs</code> - is the range</p><hr><h2><a name="method_create_new">create_new</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>create_new</strong>()</code></p><p>create new result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - null</p><hr><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p>asks if the range is empty?</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - first item in range</p><hr><h2><a name="method_get">get</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get</strong>(int i)</code></p><p></p><h3>Parameters</h3><p><code>i</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - item from range</p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.ListIterator <strong>iterator</strong>()</code></p><p>interate through range.</p><h3>Returns</h3><p><code>java.util.ListIterator</code> - tail</p><hr><h2><a name="method_release">release</a></h2><p><code>public void <strong>release</strong>()</code></p><p>release</p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code> - size</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_add">add</a></h2><p><code>public void <strong>add</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType item)</code></p><p>item is an integer to add to the range.</p><h3>Parameters</h3><p><code>item</code> - is an integer.</p><hr><h2><a name="method_clear">clear</a></h2><p><code>public void <strong>clear</strong>()</code></p><p>clear range</p><hr><h2><a name="method_concat">concat</a></h2><p><code>public void <strong>concat</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p>remove the tail from the range given.</p><h3>Parameters</h3><p><code>rs</code> - is the range</p><hr><h2><a name="method_create_new">create_new</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>create_new</strong>()</code></p><p>create new result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - null</p><hr><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p>asks if the range is empty?</p><h3>Returns</h3><p><code>boolean</code> - boolean</p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - first item in range</p><hr><h2><a name="method_firstValue">firstValue</a></h2><p><code>public java.lang.Object <strong>firstValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code> - first item in range</p><hr><h2><a name="method_get">get</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get</strong>(int i)</code></p><p></p><h3>Parameters</h3><p><code>i</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - item from range</p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.ListIterator <strong>iterator</strong>()</code></p><p>interate through range.</p><h3>Returns</h3><p><code>java.util.ListIterator</code> - tail</p><hr><h2><a name="method_release">release</a></h2><p><code>public void <strong>release</strong>()</code></p><p>release</p><hr><h2><a name="method_sequenceType">sequenceType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>sequenceType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code> - size</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis.html
index b20fca4..48383c1 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis.html
@@ -1,13 +1,19 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
                Class SelfAxis</h2><br><hr><pre>public class <strong>SelfAxis</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>Create a result sequence that contains the context node<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_SelfAxis">SelfAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+extends org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis</pre>Create a result sequence that contains the context node<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_SelfAxis">SelfAxis</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_iterate">iterate</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               create new rs and add the context node to it</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               create new rs and add the context node to it</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_SelfAxis">SelfAxis</a></h2><p><code>public <strong>SelfAxis</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
+               </h2></td></tr></table><h2><a name="method_iterate">iterate</a></h2><p><code>public void <strong>iterate</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType node
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext dc)</code></p><p>create new rs and add the context node to it</p><h3>Parameters</h3><p><code>node</code> - is the node type</p><p><code>dc</code> - is the dynamic context</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - rs containing node</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.ResultBuffer copyInto
+         ,
+      org.w3c.dom.Node limitNode)</code></p><p>create new rs and add the context node to it</p><h3>Parameters</h3><p><code>node</code> - is the node type</p><p><code>copyInto</code></p><p><code>limitNode</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public java.lang.String <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SeqType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SeqType.html
index 410ff55..5946d14 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SeqType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SeqType.html
@@ -18,9 +18,11 @@
          ,
       int occ)</code></td></tr><tr><td><code><strong><a href="#con_SeqType">SeqType</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType st
          ,
-      org.eclipse.wst.xml.xpath2.processor.StaticContext sc
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc
          ,
-      org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></td></tr><tr><td><code><strong><a href="#con_SeqType">SeqType</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType t)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_match">match</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence args)</code><br>
+      org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></td></tr><tr><td><code><strong><a href="#con_SeqType">SeqType</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType t)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static int</code></td><td width="" align="left"><code><a href="#method_mapSequenceTypeOccurrence">mapSequenceTypeOccurrence</a>(int occurrence)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_match">match</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence args)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                matches args</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_occurence">occurence</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -36,8 +38,8 @@
          ,
       int occ)</code></p><p></p><hr><h2><a name="con_SeqType">SeqType</a></h2><p><code>public <strong>SeqType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType st
          ,
-      org.eclipse.wst.xml.xpath2.processor.StaticContext sc
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc
          ,
-      org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><hr><h2><a name="con_SeqType">SeqType</a></h2><p><code>public <strong>SeqType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType t)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+      org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p></p><hr><h2><a name="con_SeqType">SeqType</a></h2><p><code>public <strong>SeqType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType t)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_match">match</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>match</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence args)</code></p><p>matches args</p><h3>Parameters</h3><p><code>args</code> - is a result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - a result sequence</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_occurence">occurence</a></h2><p><code>public int <strong>occurence</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code> - an integer.</p><hr><h2><a name="method_type">type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>type</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - a type.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_mapSequenceTypeOccurrence">mapSequenceTypeOccurrence</a></h2><p><code>public int <strong>mapSequenceTypeOccurrence</strong>(int occurrence)</code></p><p></p><h3>Parameters</h3><p><code>occurrence</code></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_match">match</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>match</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence args)</code></p><p>matches args</p><h3>Parameters</h3><p><code>args</code> - is a result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - a result sequence</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_occurence">occurence</a></h2><p><code>public int <strong>occurence</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code> - an integer.</p><hr><h2><a name="method_type">type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>type</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - a type.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter.html
new file mode 100644
index 0000000..300e5f4
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter.html
@@ -0,0 +1,39 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
+               Class StaticContextAdapter</h2><br><hr><pre>public class <strong>StaticContextAdapter</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_StaticContextAdapter">StaticContextAdapter</a></strong>(org.eclipse.wst.xml.xpath2.processor.StaticContext sc)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.net.URI</code></td><td width="" align="left"><code><a href="#method_getBaseUri">getBaseUri</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider</code></td><td width="" align="left"><code><a href="#method_getCollationProvider">getCollationProvider</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getCollectionType">getCollectionType</a>(java.lang.String collectionName)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getDefaultCollectionType">getDefaultCollectionType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getDefaultFunctionNamespace">getDefaultFunctionNamespace</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getDefaultNamespace">getDefaultNamespace</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_getDocumentType">getDocumentType</a>(java.net.URI documentUri)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Map</code></td><td width="" align="left"><code><a href="#method_getFunctionLibraries">getFunctionLibraries</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getInitialContextType">getInitialContextType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.StaticVariableResolver</code></td><td width="" align="left"><code><a href="#method_getInScopeVariables">getInScopeVariables</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public javax.xml.namespace.NamespaceContext</code></td><td width="" align="left"><code><a href="#method_getNamespaceContext">getNamespaceContext</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="" align="left"><code><a href="#method_getTypeModel">getTypeModel</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isXPath1Compatible">isXPath1Compatible</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Function</code></td><td width="" align="left"><code><a href="#method_resolveFunction">resolveFunction</a>(javax.xml.namespace.QName name
+         ,
+      int arity)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_StaticContextAdapter">StaticContextAdapter</a></h2><p><code>public <strong>StaticContextAdapter</strong>(org.eclipse.wst.xml.xpath2.processor.StaticContext sc)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getBaseUri">getBaseUri</a></h2><p><code>public java.net.URI <strong>getBaseUri</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.net.URI</code></p><hr><h2><a name="method_getCollationProvider">getCollationProvider</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.CollationProvider <strong>getCollationProvider</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.CollationProvider</code></p><hr><h2><a name="method_getCollectionType">getCollectionType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getCollectionType</strong>(java.lang.String collectionName)</code></p><p></p><h3>Parameters</h3><p><code>collectionName</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getDefaultCollectionType">getDefaultCollectionType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getDefaultCollectionType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getDefaultFunctionNamespace">getDefaultFunctionNamespace</a></h2><p><code>public java.lang.String <strong>getDefaultFunctionNamespace</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getDefaultNamespace">getDefaultNamespace</a></h2><p><code>public java.lang.String <strong>getDefaultNamespace</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getDocumentType">getDocumentType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>getDocumentType</strong>(java.net.URI documentUri)</code></p><p></p><h3>Parameters</h3><p><code>documentUri</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_getFunctionLibraries">getFunctionLibraries</a></h2><p><code>public java.util.Map <strong>getFunctionLibraries</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Map</code></p><hr><h2><a name="method_getInitialContextType">getInitialContextType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getInitialContextType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getInScopeVariables">getInScopeVariables</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.StaticVariableResolver <strong>getInScopeVariables</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.StaticVariableResolver</code></p><hr><h2><a name="method_getNamespaceContext">getNamespaceContext</a></h2><p><code>public javax.xml.namespace.NamespaceContext <strong>getNamespaceContext</strong>()</code></p><p></p><h3>Returns</h3><p><code>javax.xml.namespace.NamespaceContext</code></p><hr><h2><a name="method_getTypeModel">getTypeModel</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>getTypeModel</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></p><hr><h2><a name="method_isXPath1Compatible">isXPath1Compatible</a></h2><p><code>public boolean <strong>isXPath1Compatible</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_resolveFunction">resolveFunction</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Function <strong>resolveFunction</strong>(javax.xml.namespace.QName name
+         ,
+      int arity)</code></p><p></p><h3>Parameters</h3><p><code>name</code></p><p><code>arity</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Function</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPathCupRestricted.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPathCupRestricted.html
new file mode 100644
index 0000000..cd91de2
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPathCupRestricted.html
@@ -0,0 +1,21 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal</strong></font><br>
+               Class XPathCupRestricted</h2><br><hr><pre>public class <strong>XPathCupRestricted</strong>
+extends org.eclipse.wst.xml.xpath2.processor.internal.XPathCup</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XPathCupRestricted">XPathCupRestricted</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XPathCupRestricted">XPathCupRestricted</a></strong>(java_cup.runtime.Scanner s)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java_cup.runtime.Symbol</code></td><td width="" align="left"><code><a href="#method_do_action">do_action</a>(int act_num
+         ,
+      java_cup.runtime.lr_parser parser
+         ,
+      java.util.Stack stack
+         ,
+      int top)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Invoke a user supplied parse action.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_XPathCupRestricted">XPathCupRestricted</a></h2><p><code>public <strong>XPathCupRestricted</strong>()</code></p><p>Default constructor.</p><hr><h2><a name="con_XPathCupRestricted">XPathCupRestricted</a></h2><p><code>public <strong>XPathCupRestricted</strong>(java_cup.runtime.Scanner s)</code></p><p>Constructor which sets the default scanner.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_do_action">do_action</a></h2><p><code>public java_cup.runtime.Symbol <strong>do_action</strong>(int act_num
+         ,
+      java_cup.runtime.lr_parser parser
+         ,
+      java.util.Stack stack
+         ,
+      int top)</code></p><p>Invoke a user supplied parse action.</p><h3>Parameters</h3><p><code>act_num</code></p><p><code>parser</code></p><p><code>stack</code></p><p><code>top</code></p><h3>Returns</h3><p><code>java_cup.runtime.Symbol</code></p><h3>Throws:</h3><p><code>java.lang.Exception</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest.html
index ec3e1f0..4423d13 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AnyKindTest.html
@@ -2,7 +2,9 @@
                Class AnyKindTest</h2><br><hr><pre>public class <strong>AnyKindTest</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest</pre>Class to test a type of any kind. This matches any node in the expression.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AnyKindTest">AnyKindTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -14,4 +16,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_AnyKindTest">AnyKindTest</a></h2><p><code>public <strong>AnyKindTest</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest.html
index 888270d..4a6def8 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.AttributeTest.html
@@ -8,7 +8,9 @@
          ,
       boolean wild)</code></td></tr><tr><td><code><strong><a href="#con_AttributeTest">AttributeTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -26,4 +28,6 @@
       boolean wild)</code></p><p>Constructor for AttributeTest. This one takes in 2 inputs, Name and
  wildcard test(true/false).</p><hr><h2><a name="con_AttributeTest">AttributeTest</a></h2><p><code>public <strong>AttributeTest</strong>()</code></p><p>Default Constructor for AttributeTest.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr.html
index 32e13a3..3d75317 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr.html
@@ -10,10 +10,14 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType r)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Function</code></td><td width="" align="left"><code><a href="#method_function">function</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_set_function">set_function</a>(org.eclipse.wst.xml.xpath2.api.Function _function)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_CastExpr">CastExpr</a></h2><p><code>public <strong>CastExpr</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.Expr l
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType r)</code></p><p>Constructor for CastExpr.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_function">function</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Function <strong>function</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Function</code></p><hr><h2><a name="method_set_function">set_function</a></h2><p><code>public void <strong>set_function</strong>(org.eclipse.wst.xml.xpath2.api.Function _function)</code></p><p></p><h3>Parameters</h3><p><code>_function</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest.html
index 0b2502c..1392dc2 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.CommentTest.html
@@ -2,7 +2,9 @@
                Class CommentTest</h2><br><hr><pre>public class <strong>CommentTest</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest</pre>Class for Comment testing.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_CommentTest">CommentTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -14,4 +16,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_CommentTest">CommentTest</a></h2><p><code>public <strong>CommentTest</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest.html
index 40101f9..ef1eca9 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.DocumentTest.html
@@ -10,7 +10,9 @@
          ,
       java.lang.Object arg)</code></td></tr><tr><td><code><strong><a href="#con_DocumentTest">DocumentTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.AttrElemTest</code></td><td width="" align="left"><code><a href="#method_elem_test">elem_test</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -32,4 +34,6 @@
          ,
       java.lang.Object arg)</code></p><p>Constructor for DocumentTest.</p><hr><h2><a name="con_DocumentTest">DocumentTest</a></h2><p><code>public <strong>DocumentTest</strong>()</code></p><p>Default Constructor for DocumentTest.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_elem_test">elem_test</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.AttrElemTest <strong>elem_test</strong>()</code></p><p>Element test.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.ast.AttrElemTest</code> - Element test.</p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr><h2><a name="method_schema_elem_test">schema_elem_test</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest <strong>schema_elem_test</strong>()</code></p><p>Schema element test.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest</code> - Schema element test.</p><hr><h2><a name="method_type">type</a></h2><p><code>public int <strong>type</strong>()</code></p><p>Get test type.</p><h3>Returns</h3><p><code>int</code> - Type of test.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_elem_test">elem_test</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.AttrElemTest <strong>elem_test</strong>()</code></p><p>Element test.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.ast.AttrElemTest</code> - Element test.</p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr><h2><a name="method_schema_elem_test">schema_elem_test</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest <strong>schema_elem_test</strong>()</code></p><p>Schema element test.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest</code> - Schema element test.</p><hr><h2><a name="method_type">type</a></h2><p><code>public int <strong>type</strong>()</code></p><p>Get test type.</p><h3>Returns</h3><p><code>int</code> - Type of test.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest.html
index 7a45e16..8ce24b9 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.ElementTest.html
@@ -14,7 +14,9 @@
          ,
       boolean wild)</code></td></tr><tr><td><code><strong><a href="#con_ElementTest">ElementTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -41,4 +43,6 @@
       boolean wild)</code></p><p>Constructor for ElementTest. This takes in 2 inputs, Name, wildcard
  test(true/false).</p><hr><h2><a name="con_ElementTest">ElementTest</a></h2><p><code>public <strong>ElementTest</strong>()</code></p><p>Default Constructor for ElementTest.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_qmark">qmark</a></h2><p><code>public boolean <strong>qmark</strong>()</code></p><p>Set nilled property.</p><h3>Returns</h3><p><code>boolean</code> - Result of operation.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_qmark">qmark</a></h2><p><code>public boolean <strong>qmark</strong>()</code></p><p>Set nilled property.</p><h3>Returns</h3><p><code>boolean</code> - Result of operation.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall.html
index 04ae25c..6fd2658 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.FunctionCall.html
@@ -6,14 +6,18 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_arity">arity</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Arity interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               Support for Arity interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Function</code></td><td width="" align="left"><code><a href="#method_function">function</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Support for Iterator interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></td><td width="" align="left"><code><a href="#method_name">name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for QName interface.</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Support for QName interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_set_function">set_function</a>(org.eclipse.wst.xml.xpath2.api.Function _function)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_FunctionCall">FunctionCall</a></h2><p><code>public <strong>FunctionCall</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name
          ,
       java.util.Collection args)</code></p><p>Constructor for FunctionCall.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_arity">arity</a></h2><p><code>public int <strong>arity</strong>()</code></p><p>Support for Arity interface.</p><h3>Returns</h3><p><code>int</code> - Result of Arity operation.</p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p>Support for Iterator interface.</p><h3>Returns</h3><p><code>java.util.Iterator</code> - Result of Iterator operation.</p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p>Support for QName interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Result of QName operation.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_arity">arity</a></h2><p><code>public int <strong>arity</strong>()</code></p><p>Support for Arity interface.</p><h3>Returns</h3><p><code>int</code> - Result of Arity operation.</p><hr><h2><a name="method_function">function</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Function <strong>function</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Function</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p>Support for Iterator interface.</p><h3>Returns</h3><p><code>java.util.Iterator</code> - Result of Iterator operation.</p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p>Support for QName interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Result of QName operation.</p><hr><h2><a name="method_set_function">set_function</a></h2><p><code>public void <strong>set_function</strong>(org.eclipse.wst.xml.xpath2.api.Function _function)</code></p><p></p><h3>Parameters</h3><p><code>_function</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest.html
index ac9eef2..f095c60 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest.html
@@ -1,6 +1,8 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.ast</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.ast</strong></font><br>
                Class KindTest</h2><br><hr><pre>public class <strong>KindTest</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.ast.NodeTest</pre>Class for KindTest operation.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_KindTest">KindTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.ast.NodeTest</pre>Class for KindTest operation.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_KindTest">KindTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -12,4 +14,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_KindTest">KindTest</a></h2><p><code>public <strong>KindTest</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest.html
index 5b1481e..50f8bb9 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.PITest.html
@@ -4,7 +4,9 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_arg">arg</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for String arguments.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for String arguments.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -16,4 +18,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_PITest">PITest</a></h2><p><code>public <strong>PITest</strong>(java.lang.String arg)</code></p><p>Constructor for PITest.</p><hr><h2><a name="con_PITest">PITest</a></h2><p><code>public <strong>PITest</strong>()</code></p><p>Default Constructor for PITest.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_arg">arg</a></h2><p><code>public java.lang.String <strong>arg</strong>()</code></p><p>Support for String arguments.</p><h3>Returns</h3><p><code>java.lang.String</code> - Result of String operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_arg">arg</a></h2><p><code>public java.lang.String <strong>arg</strong>()</code></p><p>Support for String arguments.</p><h3>Returns</h3><p><code>java.lang.String</code> - Result of String operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest.html
index 6213b36..4e89fbf 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaAttrTest.html
@@ -4,7 +4,9 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></td><td width="" align="left"><code><a href="#method_arg">arg</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for QName interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for QName interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -16,4 +18,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_SchemaAttrTest">SchemaAttrTest</a></h2><p><code>public <strong>SchemaAttrTest</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName arg)</code></p><p>Constructor for SchemaAttrTest.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_arg">arg</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>arg</strong>()</code></p><p>Support for QName interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Result of QName operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_arg">arg</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>arg</strong>()</code></p><p>Support for QName interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Result of QName operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest.html
index 36d0787..931a8c8 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SchemaElemTest.html
@@ -2,7 +2,9 @@
                Class SchemaElemTest</h2><br><hr><pre>public class <strong>SchemaElemTest</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest</pre>Support for Schema Element Test.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_SchemaElemTest">SchemaElemTest</a></strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName arg)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -14,4 +16,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_SchemaElemTest">SchemaElemTest</a></h2><p><code>public <strong>SchemaElemTest</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.QName arg)</code></p><p>Constructor for SchemaElemTest.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p>Support for QName interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Result of QName operation.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p>Support for QName interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Result of QName operation.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType.html
index f459d86..5229153 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType.html
@@ -14,7 +14,9 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType it)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType</code></td><td width="" align="left"><code><a href="#method_item_type">item_type</a>()</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isLengthValid">isLengthValid</a>(int length)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType</code></td><td width="" align="left"><code><a href="#method_item_type">item_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Support for ItemType interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_occurrence">occurrence</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -26,4 +28,4 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType it)</code></p><p>Constructor for SequenceType.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_item_type">item_type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType <strong>item_type</strong>()</code></p><p>Support for ItemType interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType</code> - Result of ItemType operation.</p><hr><h2><a name="method_occurrence">occurrence</a></h2><p><code>public int <strong>occurrence</strong>()</code></p><p>Get occurence of item.</p><h3>Returns</h3><p><code>int</code> - Result from Int operation.</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_isLengthValid">isLengthValid</a></h2><p><code>public boolean <strong>isLengthValid</strong>(int length)</code></p><p></p><h3>Parameters</h3><p><code>length</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_item_type">item_type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType <strong>item_type</strong>()</code></p><p>Support for ItemType interface.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType</code> - Result of ItemType operation.</p><hr><h2><a name="method_occurrence">occurrence</a></h2><p><code>public int <strong>occurrence</strong>()</code></p><p>Get occurence of item.</p><h3>Returns</h3><p><code>int</code> - Result from Int operation.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest.html
index 85070da..5936668 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.ast.TextTest.html
@@ -2,7 +2,9 @@
                Class TextTest</h2><br><hr><pre>public class <strong>TextTest</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.ast.KindTest</pre>Class to match any text node.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_TextTest">TextTest</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_accept">accept</a>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Support for Visitor interface.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_createTestType">createTestType</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getXDMClassType">getXDMClassType</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -14,4 +16,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_TextTest">TextTest</a></h2><p><code>public <strong>TextTest</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_accept">accept</a></h2><p><code>public java.lang.Object <strong>accept</strong>(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathVisitor v)</code></p><p>Support for Visitor interface.</p><h3>Parameters</h3><p><code>v</code></p><h3>Returns</h3><p><code>java.lang.Object</code> - Result of Visitor operation.</p><hr><h2><a name="method_createTestType">createTestType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>createTestType</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
+         ,
+      org.eclipse.wst.xml.xpath2.api.StaticContext sc)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><p><code>sc</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_getXDMClassType">getXDMClassType</a></h2><p><code>public java.lang.Class <strong>getXDMClassType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_isWild">isWild</a></h2><p><code>public boolean <strong>isWild</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_name">name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>name</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType.html
index 0ed53a8..4757c95 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType.html
@@ -1,11 +1,41 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class AnyType</h2><br><hr><pre>public class <strong>AnyType</strong>
-extends java.lang.Object</pre>Common base for every type<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AnyType">AnyType</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+extends java.lang.Object</pre>Common base for every type<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected static  javax.xml.datatype.DatatypeFactory</code></td><td width="80%" align="left"><code><a href="#field__datatypeFactory">_datatypeFactory</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AnyType">AnyType</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_empty">empty</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_first">first</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_firstValue">firstValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_getItemType">getItemType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's text representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Returns the "new style" of TypeDefinition for this item.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_item">item</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_itemType">itemType</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Iterator</code></td><td width="" align="left"><code><a href="#method_iterator">iterator</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></td><td width="" align="left"><code><a href="#method_sequenceType">sequenceType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_size">size</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's name</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_value">value</a>(int index)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field__datatypeFactory">_datatypeFactory</a></h2><p><code>protected static  javax.xml.datatype.DatatypeFactory <strong>_datatypeFactory</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_AnyType">AnyType</a></h2><p><code>public <strong>AnyType</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - Datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - Datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_empty">empty</a></h2><p><code>public boolean <strong>empty</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_first">first</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>first</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr><h2><a name="method_firstValue">firstValue</a></h2><p><code>public java.lang.Object <strong>firstValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getItemType">getItemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>getItemType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves the datatype's text representation</p><h3>Returns</h3><p><code>java.lang.String</code> - Value as a string</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p>Returns the "new style" of TypeDefinition for this item.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - Type definition (possibly backed by a schema type)</p><hr><h2><a name="method_item">item</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>item</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><hr><h2><a name="method_itemType">itemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>itemType</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_iterator">iterator</a></h2><p><code>public java.util.Iterator <strong>iterator</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Iterator</code></p><hr><h2><a name="method_sequenceType">sequenceType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.ItemType <strong>sequenceType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.ItemType</code></p><hr><h2><a name="method_size">size</a></h2><p><code>public int <strong>size</strong>()</code></p><p></p><h3>Returns</h3><p><code>int</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - Datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.Object <strong>value</strong>(int index)</code></p><p></p><h3>Parameters</h3><p><code>index</code></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType.html
index a683ac0..49869d0 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType.html
@@ -1,21 +1,31 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class AttrType</h2><br><hr><pre>public class <strong>AttrType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the AttributeType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AttrType">AttrType</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_AttrType">AttrType</a></strong>(org.w3c.dom.Attr v)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isAttrType">isAttrType</a>(java.lang.String typeName)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the AttributeType datatype<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>package-private org.w3c.dom.Attr</code></td><td width="80%" align="left"><code><a href="#field__value">_value</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_AttrType">AttrType</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_AttrType">AttrType</a></strong>(org.w3c.dom.Attr v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the attribute being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isAttrType">isAttrType</a>(java.lang.String typeName)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDREF">isIDREF</a>()</code><br>
+               Checks if the current node is of type ID</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDREF">isIDREF</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></td><td width="" align="left"><code><a href="#method_node_name">node_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the name of the node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the attribute being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the attribute being stored</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field__value">_value</a></h2><p><code>package-private org.w3c.dom.Attr <strong>_value</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_AttrType">AttrType</a></h2><p><code>public <strong>AttrType</strong>()</code></p><p>Initialises to null</p><hr><h2><a name="con_AttrType">AttrType</a></h2><p><code>public <strong>AttrType</strong>(org.w3c.dom.Attr v)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_AttrType">AttrType</a></h2><p><code>public <strong>AttrType</strong>()</code></p><p>Initialises to null</p><hr><h2><a name="con_AttrType">AttrType</a></h2><p><code>public <strong>AttrType</strong>(org.w3c.dom.Attr v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_isAttrType">isAttrType</a></h2><p><code>protected boolean <strong>isAttrType</strong>(java.lang.String typeName)</code></p><p></p><h3>Parameters</h3><p><code>typeName</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Name of the node</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "attribute" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the attribute being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the attribute being stored</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the attribute being stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the attribute being stored</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the attribute being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the attribute being stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isAttrType">isAttrType</a></h2><p><code>protected boolean <strong>isAttrType</strong>(java.lang.String typeName)</code></p><p></p><h3>Parameters</h3><p><code>typeName</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p>Checks if the current node is of type ID</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - Name of the node</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "attribute" which is the datatype's full pathname</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the attribute being stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the attribute being stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType.html
index 91941b2..3ad288e 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType.html
@@ -1,6 +1,10 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class CalendarType</h2><br><hr><pre>public class <strong>CalendarType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>Common base for all Calendar based classes<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_CalendarType">CalendarType</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aat)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>Common base for all Calendar based classes<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_CalendarType">CalendarType</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Calendar</code></td><td width="" align="left"><code><a href="#method_calendar">calendar</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aat)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Calendar</code></td><td width="" align="left"><code><a href="#method_normalizeCalendar">normalizeCalendar</a>(java.util.Calendar cal
          ,
@@ -10,6 +14,6 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_CalendarType">CalendarType</a></h2><p><code>public <strong>CalendarType</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_normalizeCalendar">normalizeCalendar</a></h2><p><code>public java.util.Calendar <strong>normalizeCalendar</strong>(java.util.Calendar cal
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.Calendar</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_normalizeCalendar">normalizeCalendar</a></h2><p><code>public java.util.Calendar <strong>normalizeCalendar</strong>(java.util.Calendar cal
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration timezone)</code></p><p></p><h3>Parameters</h3><p><code>cal</code></p><p><code>timezone</code></p><h3>Returns</h3><p><code>java.util.Calendar</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CommentType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CommentType.html
index c17922c..bbd04f5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CommentType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CommentType.html
@@ -1,6 +1,12 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class CommentType</h2><br><hr><pre>public class <strong>CommentType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the CommentType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_CommentType">CommentType</a></strong>(org.w3c.dom.Comment v)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the CommentType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_CommentType">CommentType</a></strong>(org.w3c.dom.Comment v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the comment being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDREF">isIDREF</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -8,12 +14,12 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Unsupported method for this node.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the comment being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the comment stored</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_CommentType">CommentType</a></h2><p><code>public <strong>CommentType</strong>(org.w3c.dom.Comment v)</code></p><p>Initialise according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_CommentType">CommentType</a></h2><p><code>public <strong>CommentType</strong>(org.w3c.dom.Comment v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p>Initialise according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Unsupported method for this node.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - null</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "comment" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the comment being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the comment being stored</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the comment stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the comment stored</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the comment being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the comment being stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Unsupported method for this node.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - null</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "comment" which is the datatype's full pathname</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the comment stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the comment stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType.html
index 54b93e8..e259ba0 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType.html
@@ -1,11 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class CtrType</h2><br><hr><pre>public class <strong>CtrType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</pre>A representation of the CtrType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_CtrType">CtrType</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</pre>A representation of the CtrType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_CtrType">CtrType</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Used for constructor function.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               Used for constructor function.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's name</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_CtrType">CtrType</a></h2><p><code>public <strong>CtrType</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Used for constructor function.</p><h3>Parameters</h3><p><code>arg</code> - Either an empty sequence or 1 atomic type</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - The resulting ResultSequence</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Used for constructor function.</p><h3>Parameters</h3><p><code>arg</code> - Either an empty sequence or 1 atomic type</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - The resulting ResultSequence</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.DocType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.DocType.html
index 2e19780..497231d 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.DocType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.DocType.html
@@ -1,6 +1,12 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class DocType</h2><br><hr><pre>public class <strong>DocType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the DocumentType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DocType">DocType</a></strong>(org.w3c.dom.Document v)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the DocumentType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_DocType">DocType</a></strong>(org.w3c.dom.Document v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the document being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDREF">isIDREF</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -8,14 +14,14 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the name of the node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the document being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the document being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.Document</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual document being represented</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_DocType">DocType</a></h2><p><code>public <strong>DocType</strong>(org.w3c.dom.Document v)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_DocType">DocType</a></h2><p><code>public <strong>DocType</strong>(org.w3c.dom.Document v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - QName representation of the name of the node</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "document" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the document being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the document being stored</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the document being stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the document being stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public org.w3c.dom.Document <strong>value</strong>()</code></p><p>Retrieves the actual document being represented</p><h3>Returns</h3><p><code>org.w3c.dom.Document</code> - Actual document being represented</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the document being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the document being stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - QName representation of the name of the node</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "document" which is the datatype's full pathname</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the document being stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the document being stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public org.w3c.dom.Document <strong>value</strong>()</code></p><p>Retrieves the actual document being represented</p><h3>Returns</h3><p><code>org.w3c.dom.Document</code> - Actual document being represented</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType.html
index 3218ca9..8a7ef10 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType.html
@@ -1,32 +1,33 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class ElementType</h2><br><hr><pre>public class <strong>ElementType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the ElementType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ElementType">ElementType</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_ElementType">ElementType</a></strong>(org.w3c.dom.Element v)</code></td></tr><tr><td><code><strong><a href="#con_ElementType">ElementType</a></strong>(org.w3c.dom.Element v
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the ElementType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_ElementType">ElementType</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_ElementType">ElementType</a></strong>(org.w3c.dom.Element v
          ,
-      int nodePosition)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isElementType">isElementType</a>(java.lang.String typeName)</code><br>
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the element being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isElementType">isElementType</a>(java.lang.String typeName)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDREF">isIDREF</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_nilled">nilled</a>()</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_nilled">nilled</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></td><td width="" align="left"><code><a href="#method_node_name">node_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the name of the node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public static java.lang.String</code></td><td width="" align="left"><code><a href="#method_textnode_strings">textnode_strings</a>(org.w3c.dom.Node node)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the element being stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public static java.lang.String</code></td><td width="" align="left"><code><a href="#method_textnode_strings">textnode_strings</a>(org.w3c.dom.Node node)</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Recursively concatenate TextNode strings</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
+               Recursively concatenate TextNode strings</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the element stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.Element</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual element value being represented</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_ElementType">ElementType</a></h2><p><code>public <strong>ElementType</strong>()</code></p><p>Initialises to a null element</p><hr><h2><a name="con_ElementType">ElementType</a></h2><p><code>public <strong>ElementType</strong>(org.w3c.dom.Element v)</code></p><p>Initialises according to the supplied parameters</p><hr><h2><a name="con_ElementType">ElementType</a></h2><p><code>public <strong>ElementType</strong>(org.w3c.dom.Element v
+               </h2></td></tr></table><h2><a name="con_ElementType">ElementType</a></h2><p><code>public <strong>ElementType</strong>()</code></p><p>Initialises to a null element</p><hr><h2><a name="con_ElementType">ElementType</a></h2><p><code>public <strong>ElementType</strong>(org.w3c.dom.Element v
          ,
-      int nodePosition)</code></p><p>This deprecated and will be removed. Adopters need to use
- ElementType(Element)</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_isElementType">isElementType</a></h2><p><code>protected boolean <strong>isElementType</strong>(java.lang.String typeName)</code></p><p></p><h3>Parameters</h3><p><code>typeName</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_nilled">nilled</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>nilled</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - QName representation of the name of the node</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "element" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the element being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the element being stored</p><hr><h2><a name="method_textnode_strings">textnode_strings</a></h2><p><code>public java.lang.String <strong>textnode_strings</strong>(org.w3c.dom.Node node)</code></p><p>Recursively concatenate TextNode strings</p><h3>Parameters</h3><p><code>node</code> - Node to recurse</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the node supplied</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the element stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the element stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public org.w3c.dom.Element <strong>value</strong>()</code></p><p>Retrieves the actual element value being represented</p><h3>Returns</h3><p><code>org.w3c.dom.Element</code> - Actual element value being represented</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the element being stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the element being stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isElementType">isElementType</a></h2><p><code>protected boolean <strong>isElementType</strong>(java.lang.String typeName)</code></p><p></p><h3>Parameters</h3><p><code>typeName</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_nilled">nilled</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>nilled</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - QName representation of the name of the node</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "element" which is the datatype's full pathname</p><hr><h2><a name="method_textnode_strings">textnode_strings</a></h2><p><code>public java.lang.String <strong>textnode_strings</strong>(org.w3c.dom.Node node)</code></p><p>Recursively concatenate TextNode strings</p><h3>Parameters</h3><p><code>node</code> - Node to recurse</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the node supplied</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the element stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the element stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public org.w3c.dom.Element <strong>value</strong>()</code></p><p>Retrieves the actual element value being represented</p><h3>Returns</h3><p><code>org.w3c.dom.Element</code> - Actual element value being represented</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeItemTypeImpl.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeItemTypeImpl.html
new file mode 100644
index 0000000..861c5b6
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeItemTypeImpl.html
@@ -0,0 +1,37 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
+               Class NodeItemTypeImpl</h2><br><hr><pre>public class <strong>NodeItemTypeImpl</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_NodeItemTypeImpl">NodeItemTypeImpl</a></strong>(short occurrence
+         ,
+      short nodeType)</code></td></tr><tr><td><code><strong><a href="#con_NodeItemTypeImpl">NodeItemTypeImpl</a></strong>(short nodeType)</code></td></tr><tr><td><code><strong><a href="#con_NodeItemTypeImpl">NodeItemTypeImpl</a></strong>(short occurrence
+         ,
+      short nodeType
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDefinition
+         ,
+      javax.xml.namespace.QName name
+         ,
+      boolean wildcard)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public javax.xml.namespace.QName</code></td><td width="" align="left"><code><a href="#method_getName">getName</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getNodeType">getNodeType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getOccurrence">getOccurrence</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isWildcard">isWildcard</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_NodeItemTypeImpl">NodeItemTypeImpl</a></h2><p><code>public <strong>NodeItemTypeImpl</strong>(short occurrence
+         ,
+      short nodeType)</code></p><p></p><hr><h2><a name="con_NodeItemTypeImpl">NodeItemTypeImpl</a></h2><p><code>public <strong>NodeItemTypeImpl</strong>(short nodeType)</code></p><p></p><hr><h2><a name="con_NodeItemTypeImpl">NodeItemTypeImpl</a></h2><p><code>public <strong>NodeItemTypeImpl</strong>(short occurrence
+         ,
+      short nodeType
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDefinition
+         ,
+      javax.xml.namespace.QName name
+         ,
+      boolean wildcard)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getName">getName</a></h2><p><code>public javax.xml.namespace.QName <strong>getName</strong>()</code></p><p></p><h3>Returns</h3><p><code>javax.xml.namespace.QName</code></p><hr><h2><a name="method_getNodeType">getNodeType</a></h2><p><code>public short <strong>getNodeType</strong>()</code></p><p></p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getOccurrence">getOccurrence</a></h2><p><code>public short <strong>getOccurrence</strong>()</code></p><p></p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isWildcard">isWildcard</a></h2><p><code>public boolean <strong>isWildcard</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.html
index bfbdd20..f0b0f8e 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.html
@@ -1,10 +1,16 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class NodeType</h2><br><hr><pre>public class <strong>NodeType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</pre>A representation of a Node datatype<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected static  java.lang.String</code></td><td width="80%" align="left"><code><a href="#field_SCHEMA_TYPE_ID">SCHEMA_TYPE_ID</a></code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</pre>A representation of a Node datatype<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="80%" align="left"><code><a href="#field__typeModel">_typeModel</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  java.util.Comparator</code></td><td width="80%" align="left"><code><a href="#field_NODE_COMPARATOR">NODE_COMPARATOR</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected static  java.lang.String</code></td><td width="80%" align="left"><code><a href="#field_SCHEMA_TYPE_ID">SCHEMA_TYPE_ID</a></code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>protected static  java.lang.String</code></td><td width="80%" align="left"><code><a href="#field_SCHEMA_TYPE_IDREF">SCHEMA_TYPE_IDREF</a></code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_NodeType">NodeType</a></strong>(org.w3c.dom.Node node)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_after">after</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType two)</code><br>
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_NodeType">NodeType</a></strong>(org.w3c.dom.Node node
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_after">after</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType two)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public static boolean</code></td><td width="" align="left"><code><a href="#method_after">after</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType a
          ,
@@ -16,11 +22,23 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType b)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></td><td width="" align="left"><code><a href="#method_dom_to_xpath">dom_to_xpath</a>(org.w3c.dom.Node node)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></td><td width="" align="left"><code><a href="#method_dom_to_xpath">dom_to_xpath</a>(org.w3c.dom.Node node
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_eliminate_dups">eliminate_dups</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getTypedValueForPrimitiveType">getTypedValueForPrimitiveType</a>(org.apache.xerces.xs.XSTypeDefinition typeDef)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getType">getType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Looks up the available type for the node, if available</td></tr><tr valign="top"><td width="20%" align="right"><code>protected java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getTypedValueForPrimitiveType">getTypedValueForPrimitiveType</a>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDef)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="" align="left"><code><a href="#method_getTypeModel">getTypeModel</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_getXDMTypedValue">getXDMTypedValue</a>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDef
+         ,
+      java.util.List itemValTypes)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -30,7 +48,9 @@
          ,
       java.lang.String typeName)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Utility method to check to see if a particular TypeInfo matches.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_nilled">nilled</a>()</code><br>
+               Utility method to check to see if a particular TypeInfo matches.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></td><td width="" align="left"><code><a href="#method_linarize">linarize</a>(org.eclipse.wst.xml.xpath2.api.ResultBuffer rs)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_nilled">nilled</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code></td><td width="" align="left"><code><a href="#method_node_name">node_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -42,20 +62,26 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_sort_document_order">sort_document_order</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual node being represented</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Field Detail
-               </h2></td></tr></table><h2><a name="field_SCHEMA_TYPE_ID">SCHEMA_TYPE_ID</a></h2><p><code>protected static  java.lang.String <strong>SCHEMA_TYPE_ID</strong></code></p><hr><h2><a name="field_SCHEMA_TYPE_IDREF">SCHEMA_TYPE_IDREF</a></h2><p><code>protected static  java.lang.String <strong>SCHEMA_TYPE_IDREF</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="field__typeModel">_typeModel</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>_typeModel</strong></code></p><hr><h2><a name="field_NODE_COMPARATOR">NODE_COMPARATOR</a></h2><p><code>public static  java.util.Comparator <strong>NODE_COMPARATOR</strong></code></p><hr><h2><a name="field_SCHEMA_TYPE_ID">SCHEMA_TYPE_ID</a></h2><p><code>protected static  java.lang.String <strong>SCHEMA_TYPE_ID</strong></code></p><hr><h2><a name="field_SCHEMA_TYPE_IDREF">SCHEMA_TYPE_IDREF</a></h2><p><code>protected static  java.lang.String <strong>SCHEMA_TYPE_IDREF</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_NodeType">NodeType</a></h2><p><code>public <strong>NodeType</strong>(org.w3c.dom.Node node)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_NodeType">NodeType</a></h2><p><code>public <strong>NodeType</strong>(org.w3c.dom.Node node
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
                </h2></td></tr></table><h2><a name="method_after">after</a></h2><p><code>public boolean <strong>after</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType two)</code></p><p></p><h3>Parameters</h3><p><code>two</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_after">after</a></h2><p><code>public boolean <strong>after</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType a
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType b)</code></p><p></p><h3>Parameters</h3><p><code>a</code></p><p><code>b</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_before">before</a></h2><p><code>public boolean <strong>before</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType two)</code></p><p></p><h3>Parameters</h3><p><code>two</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_before">before</a></h2><p><code>public boolean <strong>before</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType a
          ,
-      org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType b)</code></p><p></p><h3>Parameters</h3><p><code>a</code></p><p><code>b</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_dom_to_xpath">dom_to_xpath</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType <strong>dom_to_xpath</strong>(org.w3c.dom.Node node)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></p><hr><h2><a name="method_eliminate_dups">eliminate_dups</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>eliminate_dups</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><hr><h2><a name="method_getTypedValueForPrimitiveType">getTypedValueForPrimitiveType</a></h2><p><code>protected java.lang.Object <strong>getTypedValueForPrimitiveType</strong>(org.apache.xerces.xs.XSTypeDefinition typeDef)</code></p><p></p><h3>Parameters</h3><p><code>typeDef</code></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isType">isType</a></h2><p><code>protected boolean <strong>isType</strong>(org.w3c.dom.TypeInfo typeInfo
+      org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType b)</code></p><p></p><h3>Parameters</h3><p><code>a</code></p><p><code>b</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_dom_to_xpath">dom_to_xpath</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType <strong>dom_to_xpath</strong>(org.w3c.dom.Node node
          ,
-      java.lang.String typeName)</code></p><p>Utility method to check to see if a particular TypeInfo matches.</p><h3>Parameters</h3><p><code>typeInfo</code></p><p><code>typeName</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_nilled">nilled</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>nilled</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - QName representation of the name of the node</p><hr><h2><a name="method_node_value">node_value</a></h2><p><code>public org.w3c.dom.Node <strong>node_value</strong>()</code></p><p>Retrieves the actual node being represented</p><h3>Returns</h3><p><code>org.w3c.dom.Node</code> - Actual node being represented</p><hr><h2><a name="method_same">same</a></h2><p><code>public boolean <strong>same</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType a
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p></p><h3>Parameters</h3><p><code>node</code></p><p><code>tm</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</code></p><hr><h2><a name="method_eliminate_dups">eliminate_dups</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>eliminate_dups</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getType">getType</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getType</strong>()</code></p><p>Looks up the available type for the node, if available</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code> - TypeDefinition, or null</p><hr><h2><a name="method_getTypedValueForPrimitiveType">getTypedValueForPrimitiveType</a></h2><p><code>protected java.lang.Object <strong>getTypedValueForPrimitiveType</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDef)</code></p><p></p><h3>Parameters</h3><p><code>typeDef</code></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeModel">getTypeModel</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>getTypeModel</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></p><hr><h2><a name="method_getXDMTypedValue">getXDMTypedValue</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>getXDMTypedValue</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDef
          ,
-      org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType b)</code></p><p></p><h3>Parameters</h3><p><code>a</code></p><p><code>b</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_sort_document_order">sort_document_order</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>sort_document_order</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>typed_value</strong>()</code></p><p>Retrieves the actual node being represented</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - Actual node being represented</p><hr></body></html>
\ No newline at end of file
+      java.util.List itemValTypes)</code></p><p></p><h3>Parameters</h3><p><code>typeDef</code></p><p><code>itemValTypes</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isType">isType</a></h2><p><code>protected boolean <strong>isType</strong>(org.w3c.dom.TypeInfo typeInfo
+         ,
+      java.lang.String typeName)</code></p><p>Utility method to check to see if a particular TypeInfo matches.</p><h3>Parameters</h3><p><code>typeInfo</code></p><p><code>typeName</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_linarize">linarize</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultBuffer <strong>linarize</strong>(org.eclipse.wst.xml.xpath2.api.ResultBuffer rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultBuffer</code></p><hr><h2><a name="method_nilled">nilled</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>nilled</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Retrieves the name of the node</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - QName representation of the name of the node</p><hr><h2><a name="method_node_value">node_value</a></h2><p><code>public org.w3c.dom.Node <strong>node_value</strong>()</code></p><p>Retrieves the actual node being represented</p><h3>Returns</h3><p><code>org.w3c.dom.Node</code> - Actual node being represented</p><hr><h2><a name="method_same">same</a></h2><p><code>public boolean <strong>same</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType a
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType b)</code></p><p></p><h3>Parameters</h3><p><code>a</code></p><p><code>b</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_sort_document_order">sort_document_order</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>sort_document_order</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>typed_value</strong>()</code></p><p>Retrieves the actual node being represented</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - Actual node being represented</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType.html
index 51476e3..befdd27 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType.html
@@ -6,13 +6,17 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Returns the smallest integer greater than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_floor">floor</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get_single_arg">get_single_arg</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code><br>
+               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_get_single_arg">get_single_arg</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get_single_type">get_single_type</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_get_single_type">get_single_type</a>(org.eclipse.wst.xml.xpath2.api.Item at
          ,
       java.lang.Class type)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Check whether the supplied node is of the supplied type</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get_single_type">get_single_type</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs
+               Check whether the supplied node is of the supplied type</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_get_single_type">get_single_type</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at
+         ,
+      java.lang.Class type)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_get_single_type">get_single_type</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
          ,
       java.lang.Class type)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -23,7 +27,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Returns the closest integer of the number stored.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_round_half_to_even">round_half_to_even</a>(int precision)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence representing the negation of the number
  stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_zero">zero</a>()</code><br>
@@ -32,10 +36,12 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_NumericType">NumericType</a></h2><p><code>public <strong>NumericType</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - New NumericType representing the absolute of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_get_single_arg">get_single_arg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get_single_arg</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_get_single_type">get_single_type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get_single_type</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at
+               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - New NumericType representing the absolute of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_get_single_arg">get_single_arg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.Item <strong>get_single_arg</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_get_single_type">get_single_type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>get_single_type</strong>(org.eclipse.wst.xml.xpath2.api.Item at
          ,
-      java.lang.Class type)</code></p><p>Check whether the supplied node is of the supplied type</p><h3>Parameters</h3><p><code>at</code> - The node being tested</p><p><code>type</code> - The type expected</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - The node being tested</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - If node being tested is not of expected type</code></p><hr><h2><a name="method_get_single_type">get_single_type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get_single_type</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence rs
+      java.lang.Class type)</code></p><p>Check whether the supplied node is of the supplied type</p><h3>Parameters</h3><p><code>at</code> - The node being tested</p><p><code>type</code> - The type expected</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code> - The node being tested</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - If node being tested is not of expected type</code></p><hr><h2><a name="method_get_single_type">get_single_type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.Item <strong>get_single_type</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at
+         ,
+      java.lang.Class type)</code></p><p></p><h3>Parameters</h3><p><code>at</code></p><p><code>type</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_get_single_type">get_single_type</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>get_single_type</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs
          ,
       java.lang.Class type)</code></p><p>Check whether first node in supplied ResultSequence is of the supplied
- type</p><h3>Parameters</h3><p><code>rs</code> - The node being tested</p><p><code>type</code> - The type expected</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - The node being tested</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - If node being tested is not of expected type</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p></p><h3>Parameters</h3><p><code>precision</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>unary_minus</strong>()</code></p><p>Creates a new ResultSequence representing the negation of the number
- stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence representing the negation of the number stored</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check whether node represnts 0</p><h3>Returns</h3><p><code>boolean</code> - True if node represnts 0. False otherwise</p><hr></body></html>
\ No newline at end of file
+ type</p><h3>Parameters</h3><p><code>rs</code> - The node being tested</p><p><code>type</code> - The type expected</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code> - The node being tested</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError - If node being tested is not of expected type</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A NumericType representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p></p><h3>Parameters</h3><p><code>precision</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>unary_minus</strong>()</code></p><p>Creates a new ResultSequence representing the negation of the number
+ stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence representing the negation of the number stored</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check whether node represnts 0</p><h3>Returns</h3><p><code>boolean</code> - True if node represnts 0. False otherwise</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.PIType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.PIType.html
index 5027c68..5daf603 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.PIType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.PIType.html
@@ -1,6 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class PIType</h2><br><hr><pre>public class <strong>PIType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the ProcessingInstruction datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_PIType">PIType</a></strong>(org.w3c.dom.ProcessingInstruction v)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the ProcessingInstruction datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_PIType">PIType</a></strong>(org.w3c.dom.ProcessingInstruction v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the actual processing instruction
+ stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDREF">isIDREF</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -8,18 +15,17 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Constructs the node's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the actual processing instruction
- stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the processing instruction
  stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.w3c.dom.ProcessingInstruction</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual processing instruction this node represents</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_PIType">PIType</a></h2><p><code>public <strong>PIType</strong>(org.w3c.dom.ProcessingInstruction v)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_PIType">PIType</a></h2><p><code>public <strong>PIType</strong>(org.w3c.dom.ProcessingInstruction v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p>Initialises according to the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Constructs the node's name</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - A QName representation of the node's name</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "processing-instruction" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the actual processing instruction
- stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the actual processing instruction stored</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the processing instruction
- stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the processing instruction          stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public org.w3c.dom.ProcessingInstruction <strong>value</strong>()</code></p><p>Retrieves the actual processing instruction this node represents</p><h3>Returns</h3><p><code>org.w3c.dom.ProcessingInstruction</code> - Actual processing instruction this node represents</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the actual processing instruction
+ stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the actual processing instruction stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Constructs the node's name</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - A QName representation of the node's name</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "processing-instruction" which is the datatype's full pathname</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the processing instruction
+ stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the processing instruction          stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public org.w3c.dom.ProcessingInstruction <strong>value</strong>()</code></p><p>Retrieves the actual processing instruction this node represents</p><h3>Returns</h3><p><code>org.w3c.dom.ProcessingInstruction</code> - Actual processing instruction this node represents</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.QName.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.QName.html
index 8795d15..1cb5d89 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.QName.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.QName.html
@@ -6,12 +6,14 @@
          ,
       java.lang.String ns)</code></td></tr><tr><td><code><strong><a href="#con_QName">QName</a></strong>(java.lang.String prefix
          ,
-      java.lang.String local_part)</code></td></tr><tr><td><code><strong><a href="#con_QName">QName</a></strong>(java.lang.String local_part)</code></td></tr><tr><td><code><strong><a href="#con_QName">QName</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+      java.lang.String local_part)</code></td></tr><tr><td><code><strong><a href="#con_QName">QName</a></strong>(java.lang.String local_part)</code></td></tr><tr><td><code><strong><a href="#con_QName">QName</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_QName">QName</a></strong>(javax.xml.namespace.QName name)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public javax.xml.namespace.QName</code></td><td width="" align="left"><code><a href="#method_asQName">asQName</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable QName in the
  supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this QName and the supplied QName</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_equals">equals</a>(java.lang.Object obj)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -20,7 +22,14 @@
                Check for whether a namespace has been defined for this node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_expanded_name">expanded_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the full pathname including the namespace. This method must not
- be called if a namespace does exist for this node</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_hashCode">hashCode</a>()</code><br>
+ be called if a namespace does exist for this node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the node name. This method is
+ functionally identical to string()</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_hashCode">hashCode</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Calculates the hashcode for the full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_local">local</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -38,10 +47,7 @@
                Retrieves a String representation of the node name. This method is
  functionally identical to string_value()</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the node name. This method is
- functionally identical to string()</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_toString">toString</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_toString">toString</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -53,13 +59,13 @@
          ,
       java.lang.String ns)</code></p><p>Initialises using the supplied parameters</p><hr><h2><a name="con_QName">QName</a></h2><p><code>public <strong>QName</strong>(java.lang.String prefix
          ,
-      java.lang.String local_part)</code></p><p>Initialises using the supplied parameters</p><hr><h2><a name="con_QName">QName</a></h2><p><code>public <strong>QName</strong>(java.lang.String local_part)</code></p><p>Initialises using only the node name (no prefix)</p><hr><h2><a name="con_QName">QName</a></h2><p><code>public <strong>QName</strong>()</code></p><p>Initialises with a null prefix and null node name</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+      java.lang.String local_part)</code></p><p>Initialises using the supplied parameters</p><hr><h2><a name="con_QName">QName</a></h2><p><code>public <strong>QName</strong>(java.lang.String local_part)</code></p><p>Initialises using only the node name (no prefix)</p><hr><h2><a name="con_QName">QName</a></h2><p><code>public <strong>QName</strong>()</code></p><p>Initialises with a null prefix and null node name</p><hr><h2><a name="con_QName">QName</a></h2><p><code>public <strong>QName</strong>(javax.xml.namespace.QName name)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable QName in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to extract from</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the QName supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_asQName">asQName</a></h2><p><code>public javax.xml.namespace.QName <strong>asQName</strong>()</code></p><p></p><h3>Returns</h3><p><code>javax.xml.namespace.QName</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable QName in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to extract from</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the QName supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this QName and the supplied QName</p><h3>Parameters</h3><p><code>arg</code> - The QName to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two represent the same node. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_equals">equals</a></h2><p><code>public boolean <strong>equals</strong>(java.lang.Object obj)</code></p><p>Equality comparison between this QName and a supplied QName</p><h3>Parameters</h3><p><code>obj</code> - The object to compare with. Should be of type QName</p><h3>Returns</h3><p><code>boolean</code> - True if the two represent the same node. False otherwise</p><hr><h2><a name="method_expanded">expanded</a></h2><p><code>public boolean <strong>expanded</strong>()</code></p><p>Check for whether a namespace has been defined for this node</p><h3>Returns</h3><p><code>boolean</code> - True if a namespace has been defined for node. False otherwise</p><hr><h2><a name="method_expanded_name">expanded_name</a></h2><p><code>public java.lang.String <strong>expanded_name</strong>()</code></p><p>Retrieves the full pathname including the namespace. This method must not
- be called if a namespace does exist for this node</p><h3>Returns</h3><p><code>java.lang.String</code> - Full pathname including namespace</p><hr><h2><a name="method_hashCode">hashCode</a></h2><p><code>public int <strong>hashCode</strong>()</code></p><p>Calculates the hashcode for the full pathname</p><h3>Returns</h3><p><code>int</code> - The hashcode for the full pathname</p><hr><h2><a name="method_local">local</a></h2><p><code>public java.lang.String <strong>local</strong>()</code></p><p>Retrieves the node's name</p><h3>Returns</h3><p><code>java.lang.String</code> - Node's name</p><hr><h2><a name="method_namespace">namespace</a></h2><p><code>public java.lang.String <strong>namespace</strong>()</code></p><p>Retrieves the namespace that this node belongs in. This method must not
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this QName and the supplied QName</p><h3>Parameters</h3><p><code>arg</code> - The QName to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two represent the same node. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_equals">equals</a></h2><p><code>public boolean <strong>equals</strong>(java.lang.Object obj)</code></p><p>Equality comparison between this QName and a supplied QName</p><h3>Parameters</h3><p><code>obj</code> - The object to compare with. Should be of type QName</p><h3>Returns</h3><p><code>boolean</code> - True if the two represent the same node. False otherwise</p><hr><h2><a name="method_expanded">expanded</a></h2><p><code>public boolean <strong>expanded</strong>()</code></p><p>Check for whether a namespace has been defined for this node</p><h3>Returns</h3><p><code>boolean</code> - True if a namespace has been defined for node. False otherwise</p><hr><h2><a name="method_expanded_name">expanded_name</a></h2><p><code>public java.lang.String <strong>expanded_name</strong>()</code></p><p>Retrieves the full pathname including the namespace. This method must not
+ be called if a namespace does exist for this node</p><h3>Returns</h3><p><code>java.lang.String</code> - Full pathname including namespace</p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the node name. This method is
+ functionally identical to string()</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the node name</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_hashCode">hashCode</a></h2><p><code>public int <strong>hashCode</strong>()</code></p><p>Calculates the hashcode for the full pathname</p><h3>Returns</h3><p><code>int</code> - The hashcode for the full pathname</p><hr><h2><a name="method_local">local</a></h2><p><code>public java.lang.String <strong>local</strong>()</code></p><p>Retrieves the node's name</p><h3>Returns</h3><p><code>java.lang.String</code> - Node's name</p><hr><h2><a name="method_namespace">namespace</a></h2><p><code>public java.lang.String <strong>namespace</strong>()</code></p><p>Retrieves the namespace that this node belongs in. This method must not
  be called if the node does not belong in a namespace</p><h3>Returns</h3><p><code>java.lang.String</code> - Namespace that this node belongs in</p><hr><h2><a name="method_parse_QName">parse_QName</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>parse_QName</strong>(java.lang.String str)</code></p><p>Creates a new QName by parsing a String representation of the node name</p><h3>Parameters</h3><p><code>str</code> - String representation of the name</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - null</p><hr><h2><a name="method_prefix">prefix</a></h2><p><code>public java.lang.String <strong>prefix</strong>()</code></p><p>Retrieves the prefix of the node's pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - Prefix of the node's pathname</p><hr><h2><a name="method_set_namespace">set_namespace</a></h2><p><code>public void <strong>set_namespace</strong>(java.lang.String n)</code></p><p>Sets the namespace for this node</p><h3>Parameters</h3><p><code>n</code> - Namespace this node belongs in</p><hr><h2><a name="method_string">string</a></h2><p><code>public java.lang.String <strong>string</strong>()</code></p><p>Retrieves a String representation of the node name. This method is
- functionally identical to string_value()</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the node name</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:QName" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the node name. This method is
- functionally identical to string()</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the node name</p><hr><h2><a name="method_toString">toString</a></h2><p><code>public java.lang.String <strong>toString</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "QName" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+ functionally identical to string_value()</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the node name</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:QName" which is the datatype's full pathname</p><hr><h2><a name="method_toString">toString</a></h2><p><code>public java.lang.String <strong>toString</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "QName" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SchemaTypeValueFactory.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SchemaTypeValueFactory.html
new file mode 100644
index 0000000..341b73e
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SchemaTypeValueFactory.html
@@ -0,0 +1,14 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
+               Class SchemaTypeValueFactory</h2><br><hr><pre>public class <strong>SchemaTypeValueFactory</strong>
+extends java.lang.Object</pre>A factory class implementation, to construct PsychoPath schema type representation corresponding 
+ to XML Schema types.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_SchemaTypeValueFactory">SchemaTypeValueFactory</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_newSchemaTypeValue">newSchemaTypeValue</a>(short typeDef
+         ,
+      java.lang.String strValue)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_SchemaTypeValueFactory">SchemaTypeValueFactory</a></h2><p><code>public <strong>SchemaTypeValueFactory</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_newSchemaTypeValue">newSchemaTypeValue</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>newSchemaTypeValue</strong>(short typeDef
+         ,
+      java.lang.String strValue)</code></p><p></p><h3>Parameters</h3><p><code>typeDef</code></p><p><code>strValue</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl.html
new file mode 100644
index 0000000..a91de29
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl.html
@@ -0,0 +1,15 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
+               Class SimpleAtomicItemTypeImpl</h2><br><hr><pre>public class <strong>SimpleAtomicItemTypeImpl</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_SimpleAtomicItemTypeImpl">SimpleAtomicItemTypeImpl</a></strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDefinition)</code></td></tr><tr><td><code><strong><a href="#con_SimpleAtomicItemTypeImpl">SimpleAtomicItemTypeImpl</a></strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDefinition
+         ,
+      short occurrence)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getOccurrence">getOccurrence</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_SimpleAtomicItemTypeImpl">SimpleAtomicItemTypeImpl</a></h2><p><code>public <strong>SimpleAtomicItemTypeImpl</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDefinition)</code></p><p></p><hr><h2><a name="con_SimpleAtomicItemTypeImpl">SimpleAtomicItemTypeImpl</a></h2><p><code>public <strong>SimpleAtomicItemTypeImpl</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition typeDefinition
+         ,
+      short occurrence)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getOccurrence">getOccurrence</a></h2><p><code>public short <strong>getOccurrence</strong>()</code></p><p></p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.TextType.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.TextType.html
index f14197b..3b8c7ce 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.TextType.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.TextType.html
@@ -1,6 +1,12 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class TextType</h2><br><hr><pre>public class <strong>TextType</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the TextType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_TextType">TextType</a></strong>(org.w3c.dom.Text v)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType</pre>A representation of the TextType datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_TextType">TextType</a></strong>(org.w3c.dom.Text v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the actual value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isID">isID</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Will always return false;</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isIDREF">isIDREF</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -8,12 +14,12 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Unsupported method for this nodetype.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the actual value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
+               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_typed_value">typed_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the Text value stored</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
-               </h2></td></tr></table><h2><a name="con_TextType">TextType</a></h2><p><code>public <strong>TextType</strong>(org.w3c.dom.Text v)</code></p><p>Initialises using the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               </h2></td></tr></table><h2><a name="con_TextType">TextType</a></h2><p><code>public <strong>TextType</strong>(org.w3c.dom.Text v
+         ,
+      org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel tm)</code></p><p>Initialises using the supplied parameters</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p>Will always return false;</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Unsupported method for this nodetype.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - null (no user defined name for this node gets defined)</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "text" which is the datatype's name</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the actual value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the actual value stored</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the Text value stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the Text value stored</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the actual value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the actual value stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isID">isID</a></h2><p><code>public boolean <strong>isID</strong>()</code></p><p>Will always return false;</p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_isIDREF">isIDREF</a></h2><p><code>public boolean <strong>isIDREF</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_node_name">node_name</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.QName <strong>node_name</strong>()</code></p><p>Unsupported method for this nodetype.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.QName</code> - null (no user defined name for this node gets defined)</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "text" which is the datatype's name</p><hr><h2><a name="method_typed_value">typed_value</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>typed_value</strong>()</code></p><p>Creates a new ResultSequence consisting of the Text value stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the Text value stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI.html
index 427987f..321d2e3 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI.html
@@ -1,21 +1,25 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSAnyURI</h2><br><hr><pre>public class <strong>XSAnyURI</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>Represents a Universal Resource Identifier (URI) reference<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSAnyURI">XSAnyURI</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSAnyURI">XSAnyURI</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>Represents a Universal Resource Identifier (URI) reference<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSAnyURI">XSAnyURI</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSAnyURI">XSAnyURI</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creation of a result sequence consisting of a URI from a previous result
  sequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation which
- must be of type xs:anyURI (or, by promotion of this, xs:string)</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+ must be of type xs:anyURI (or, by promotion of this, xs:string)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Greater than comparison between this and the supplied representation which
  must be of type xs:anyURI (or, by promotion of this, xs:string)</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Less than comparison between this and the supplied representation which
  must be of type xs:anyURI (or, by promotion of this, xs:string)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
@@ -29,15 +33,15 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSAnyURI">XSAnyURI</a></h2><p><code>public <strong>XSAnyURI</strong>(java.lang.String x)</code></p><p>Arity 1 Constructor</p><hr><h2><a name="con_XSAnyURI">XSAnyURI</a></h2><p><code>public <strong>XSAnyURI</strong>()</code></p><p>Arity 0 Constructor. Initiates URI to null.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creation of a result sequence consisting of a URI from a previous result
- sequence.</p><h3>Parameters</h3><p><code>arg</code> - previous result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - new result sequence consisting of the URI supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creation of a result sequence consisting of a URI from a previous result
+ sequence.</p><h3>Parameters</h3><p><code>arg</code> - previous result sequence</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - new result sequence consisting of the URI supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation which
- must be of type xs:anyURI (or, by promotion of this, xs:string)</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are of the same String. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation which
+ must be of type xs:anyURI (or, by promotion of this, xs:string)</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are of the same String. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Greater than comparison between this and the supplied representation which
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Greater than comparison between this and the supplied representation which
  must be of type xs:anyURI (or, by promotion of this, xs:string)</p><h3>Parameters</h3><p><code>arg</code></p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Less than comparison between this and the supplied representation which
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Less than comparison between this and the supplied representation which
  must be of type xs:anyURI (or, by promotion of this, xs:string)</p><h3>Parameters</h3><p><code>arg</code></p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieve full type pathname of this datatype</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:anyURI", the full type pathname of this datatype</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Transforms and retrieves the URI value of this URI datatype in String
  format</p><h3>Returns</h3><p><code>java.lang.String</code> - the URI value held by this instance of the URI datatype as a          String</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieve type name of this datatype</p><h3>Returns</h3><p><code>java.lang.String</code> - "anyURI", the type name of this datatype</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBase64Binary.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBase64Binary.html
index 8df9bbe..1939633 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBase64Binary.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBase64Binary.html
@@ -1,18 +1,22 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSBase64Binary</h2><br><hr><pre>public class <strong>XSBase64Binary</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the base64Binary datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSBase64Binary">XSBase64Binary</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSBase64Binary">XSBase64Binary</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the base64Binary datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSBase64Binary">XSBase64Binary</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSBase64Binary">XSBase64Binary</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the base64Binary value</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation which
- must be of type base64Binary</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ must be of type base64Binary</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves a String representation of the base64Binary stored. This method is
- functionally identical to value()</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+ functionally identical to value()</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -21,9 +25,9 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSBase64Binary">XSBase64Binary</a></h2><p><code>public <strong>XSBase64Binary</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSBase64Binary">XSBase64Binary</a></h2><p><code>public <strong>XSBase64Binary</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the base64Binary value</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to construct base64Binary value</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence representing base64Binary value</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the base64Binary value</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to construct base64Binary value</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence representing base64Binary value</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation which
- must be of type base64Binary</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are same. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:base64Binary" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the base64Binary stored. This method is
- functionally identical to value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The base64Binary stored</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "base64Binary" which is the datatype's name</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.String <strong>value</strong>()</code></p><p>Retrieves a String representation of the base64Binary stored. This method is
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation which
+ must be of type base64Binary</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are same. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the base64Binary stored. This method is
+ functionally identical to value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The base64Binary stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:base64Binary" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "base64Binary" which is the datatype's name</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.String <strong>value</strong>()</code></p><p>Retrieves a String representation of the base64Binary stored. This method is
  functionally identical to string_value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The base64Binary stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean.html
index 3ba00cf..69b6d87 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean.html
@@ -1,49 +1,61 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSBoolean</h2><br><hr><pre>public class <strong>XSBoolean</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of a true or a false value.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSBoolean">XSBoolean</a></strong>(boolean x)</code></td></tr><tr><td><code><strong><a href="#con_XSBoolean">XSBoolean</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of a true or a false value.<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean</code></td><td width="80%" align="left"><code><a href="#field_FALSE">FALSE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean</code></td><td width="80%" align="left"><code><a href="#field_TRUE">TRUE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSBoolean">XSBoolean</a></strong>(boolean x)</code></td></tr><tr><td><code><strong><a href="#con_XSBoolean">XSBoolean</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new result sequence consisting of the retrievable boolean value
  in the supplied result sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison for equality between the supplied and this boolean
  representation. Returns true if both represent same boolean value, false
- otherwise</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+ otherwise</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieve the String representation of the boolean value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between the supplied and this boolean representation. Returns
  true if this XSBoolean represents true and that XSBoolean supplied
  represents false. Returns false otherwise</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between the supplied and this boolean representation. Returns
  true if this XSBoolean represents false and that XSBoolean supplied
  represents true. Returns false otherwise</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieve the full type pathname of this datatype</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieve the String representation of the boolean value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               Retrieve the full type pathname of this datatype</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieve the datatype name</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the actual boolean value stored</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+               Retrieves the actual boolean value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_valueOf">valueOf</a>(boolean answer)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_FALSE">FALSE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean <strong>FALSE</strong></code></p><hr><h2><a name="field_TRUE">TRUE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean <strong>TRUE</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSBoolean">XSBoolean</a></h2><p><code>public <strong>XSBoolean</strong>(boolean x)</code></p><p>Initiates the new representation to the boolean supplied</p><hr><h2><a name="con_XSBoolean">XSBoolean</a></h2><p><code>public <strong>XSBoolean</strong>()</code></p><p>Initiates to a default representation of false.</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable boolean value
- in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the boolean value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A new result sequence consisting of the boolean value supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable boolean value
+ in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the boolean value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A new result sequence consisting of the boolean value supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison for equality between the supplied and this boolean
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Comparison for equality between the supplied and this boolean
  representation. Returns true if both represent same boolean value, false
- otherwise</p><h3>Parameters</h3><p><code>arg</code> - The XSBoolean representation of the boolean value to compare             with.</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - New XSBoolean representation of true/false result of the equality          comparison</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+ otherwise</p><h3>Parameters</h3><p><code>arg</code> - The XSBoolean representation of the boolean value to compare             with.</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - New XSBoolean representation of true/false result of the equality          comparison</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieve the String representation of the boolean value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - the String representation of the boolean value stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between the supplied and this boolean representation. Returns
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between the supplied and this boolean representation. Returns
  true if this XSBoolean represents true and that XSBoolean supplied
  represents false. Returns false otherwise</p><h3>Parameters</h3><p><code>arg</code> - The XSBoolean representation of the boolean value to compare             with.</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - New XSBoolean representation of true/false result of the          comparison</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between the supplied and this boolean representation. Returns
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between the supplied and this boolean representation. Returns
  true if this XSBoolean represents false and that XSBoolean supplied
- represents true. Returns false otherwise</p><h3>Parameters</h3><p><code>arg</code> - The XSBoolean representation of the boolean value to compare             with.</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - New XSBoolean representation of true/false result of the          comparison</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieve the full type pathname of this datatype</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:boolean", the full datatype pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieve the String representation of the boolean value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - the String representation of the boolean value stored</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieve the datatype name</p><h3>Returns</h3><p><code>java.lang.String</code> - "boolean", which is the datatype name.</p><hr><h2><a name="method_value">value</a></h2><p><code>public boolean <strong>value</strong>()</code></p><p>Retrieves the actual boolean value stored</p><h3>Returns</h3><p><code>boolean</code> - the actual boolean value stored</p><hr></body></html>
\ No newline at end of file
+ represents true. Returns false otherwise</p><h3>Parameters</h3><p><code>arg</code> - The XSBoolean representation of the boolean value to compare             with.</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - New XSBoolean representation of true/false result of the          comparison</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieve the full type pathname of this datatype</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:boolean", the full datatype pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieve the datatype name</p><h3>Returns</h3><p><code>java.lang.String</code> - "boolean", which is the datatype name.</p><hr><h2><a name="method_value">value</a></h2><p><code>public boolean <strong>value</strong>()</code></p><p>Retrieves the actual boolean value stored</p><h3>Returns</h3><p><code>boolean</code> - the actual boolean value stored</p><hr><h2><a name="method_valueOf">valueOf</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>valueOf</strong>(boolean answer)</code></p><p></p><h3>Parameters</h3><p><code>answer</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSByte.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSByte.html
index 203c77e..f7482a5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSByte.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSByte.html
@@ -1,9 +1,11 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSByte</h2><br><hr><pre>public class <strong>XSByte</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSByte">XSByte</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSByte">XSByte</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSByte">XSByte</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSByte">XSByte</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable 'byte' in the
- supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +13,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSByte">XSByte</a></h2><p><code>public <strong>XSByte</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSByte">XSByte</a></h2><p><code>public <strong>XSByte</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied byte value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable 'byte' in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the byte is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'byte' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:byte" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "byte" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable 'byte' in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the byte is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'byte' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:byte" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "byte" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate.html
index eae78bf..04af2b5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate.html
@@ -6,25 +6,29 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the Calendar representation of the date stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_clone">clone</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Creates a copy of this date representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Creates a copy of this date representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new result sequence consisting of the retrievable date value in
  the supplied result sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_day">day</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieve the day from the date stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison on this and the supplied dates (taking timezones into
- account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+ account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the date stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison on this and the supplied dates (taking timezones into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison on this and the supplied dates (taking timezones into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Comparison on this and the supplied dates (taking timezones into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical minus operator between this XSDate and a supplied result
  sequence (XSDate, XSYearMonthDuration and XSDayTimeDuration are only
@@ -34,15 +38,13 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Parses a String representation of a date (of the form year-month-day or
  year-month-day+timezone) and constructs a new XSDate representation of
- it.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ it.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition operator between this XSDate and a supplied result
  sequence (XDTYearMonthDuration and XDTDayTimeDuration are only valid
  ones).</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrive the datatype full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the date stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrive the datatype full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves whether this date has an optional timezone associated with it</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -59,19 +61,19 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initializes a new representation of a supplied date</p><hr><h2><a name="con_XSDate">XSDate</a></h2><p><code>public <strong>XSDate</strong>()</code></p><p>Initializes a new representation of the current date</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the date stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the date stored</p><hr><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a copy of this date representation</p><h3>Returns</h3><p><code>java.lang.Object</code> - A copy of this date representation</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable date value in
- the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the date value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A new result sequence consisting of the date value supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieve the day from the date stored</p><h3>Returns</h3><p><code>int</code> - the day value of the date stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the date stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the date stored</p><hr><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a copy of this date representation</p><h3>Returns</h3><p><code>java.lang.Object</code> - A copy of this date representation</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable date value in
+ the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the date value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A new result sequence consisting of the date value supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieve the day from the date stored</p><h3>Returns</h3><p><code>int</code> - the day value of the date stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison on this and the supplied dates (taking timezones into
- account)</p><h3>Parameters</h3><p><code>arg</code> - XSDate representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two dates are represent the same exact point in time.          False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison on this and the supplied dates (taking timezones into
+ account)</p><h3>Parameters</h3><p><code>arg</code> - XSDate representation of the date to compare to</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two dates are represent the same exact point in time.          False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the date stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the date stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison on this and the supplied dates (taking timezones into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDate representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if in time, this date lies after the date supplied. False          otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison on this and the supplied dates (taking timezones into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDate representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if in time, this date lies after the date supplied. False          otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison on this and the supplied dates (taking timezones into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDate representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if in time, this date lies before the date supplied. False          otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical minus operator between this XSDate and a supplied result
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison on this and the supplied dates (taking timezones into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDate representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if in time, this date lies before the date supplied. False          otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical minus operator between this XSDate and a supplied result
  sequence (XSDate, XSYearMonthDuration and XSDayTimeDuration are only
- valid ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If this is an XSDate, the result will be a             XSDayTimeDuration of the duration of time between these two             dates. If arg is an XSYearMonthDuration or an             XSDayTimeDuration the result will be a XSDate of the result of             the current date minus the duration of time supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieve the month from the date stored</p><h3>Returns</h3><p><code>int</code> - the month value of the date stored</p><hr><h2><a name="method_parse_date">parse_date</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate <strong>parse_date</strong>(java.lang.String str)</code></p><p>Parses a String representation of a date (of the form year-month-day or
+ valid ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If this is an XSDate, the result will be a             XSDayTimeDuration of the duration of time between these two             dates. If arg is an XSYearMonthDuration or an             XSDayTimeDuration the result will be a XSDate of the result of             the current date minus the duration of time supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieve the month from the date stored</p><h3>Returns</h3><p><code>int</code> - the month value of the date stored</p><hr><h2><a name="method_parse_date">parse_date</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate <strong>parse_date</strong>(java.lang.String str)</code></p><p>Parses a String representation of a date (of the form year-month-day or
  year-month-day+timezone) and constructs a new XSDate representation of
- it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the date (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate</code> - The XSDate representation of the supplied date</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDate and a supplied result
+ it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the date (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate</code> - The XSDate representation of the supplied date</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDate and a supplied result
  sequence (XDTYearMonthDuration and XDTDayTimeDuration are only valid
- ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If arg is an XDTYearMonthDuration or an             XDTDayTimeDuration the result will be a XSDate of the result             of the current date minus the duration of time supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrive the datatype full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:date" which is the datatype full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the date stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the date stored</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Retrieves whether this date has an optional timezone associated with it</p><h3>Returns</h3><p><code>boolean</code> - True if there is a timezone associated with this date. False          otherwise.</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype name</p><h3>Returns</h3><p><code>java.lang.String</code> - "date" which is the dataype name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Currently unsupported method. Retrieves the date in milliseconds since
+ ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If arg is an XDTYearMonthDuration or an             XDTDayTimeDuration the result will be a XSDate of the result             of the current date minus the duration of time supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrive the datatype full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:date" which is the datatype full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Retrieves whether this date has an optional timezone associated with it</p><h3>Returns</h3><p><code>boolean</code> - True if there is a timezone associated with this date. False          otherwise.</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype name</p><h3>Returns</h3><p><code>java.lang.String</code> - "date" which is the dataype name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Currently unsupported method. Retrieves the date in milliseconds since
  the begining of epoch</p><h3>Returns</h3><p><code>double</code> - Number of milliseconds since the begining of the epoch</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieve the year from the date stored</p><h3>Returns</h3><p><code>int</code> - the year value of the date stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime.html
index 8a2c3e6..f5433a2 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime.html
@@ -6,19 +6,23 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the Calendar representation of the date stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_clone">clone</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Creates a copy of this date and time representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Creates a copy of this date and time representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new result sequence consisting of the retrievable date and time
  value in the supplied result sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_day">day</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieve the day from the date stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison on this and the supplied dates and times (taking
- timezones into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+ timezones into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the date and time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison on this and the supplied dates and times (taking timezones
  into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_hour">hour</a>()</code><br>
@@ -27,10 +31,10 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check to see if a character is numeric</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison on this and the supplied dates and times (taking timezones
- into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ into account)</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical minus operator between this XSDateTime and a supplied result
  sequence (XSDateTime, XDTYearMonthDuration and XDTDayTimeDuration are
@@ -55,7 +59,7 @@
  timezone from it</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime</code></td><td width="" align="left"><code><a href="#method_parseDateTime">parseDateTime</a>(java.lang.String str)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Parses a String representation of a date and time and constructs a new
- XSDateTime object using that information</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ XSDateTime object using that information</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition operator between this XSDateTime and a supplied
  result sequence (XDTYearMonthDuration and XDTDayTimeDuration are only
@@ -63,9 +67,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieve the seconds from the date stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrive the datatype full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the date and time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrive the datatype full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -82,26 +84,26 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initiates a new representation of a supplied date and time</p><hr><h2><a name="con_XSDateTime">XSDateTime</a></h2><p><code>public <strong>XSDateTime</strong>()</code></p><p>Inititates a new representation of the current date and time</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the date stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the date stored</p><hr><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a copy of this date and time representation</p><h3>Returns</h3><p><code>java.lang.Object</code> - A copy of this date and time representation</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable date and time
- value in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the date and time             value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A new result sequence consisting of the date and time value          supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieve the day from the date stored</p><h3>Returns</h3><p><code>int</code> - the day value of the date stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the date stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the date stored</p><hr><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a copy of this date and time representation</p><h3>Returns</h3><p><code>java.lang.Object</code> - A copy of this date and time representation</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable date and time
+ value in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the date and time             value.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A new result sequence consisting of the date and time value          supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieve the day from the date stored</p><h3>Returns</h3><p><code>int</code> - the day value of the date stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison on this and the supplied dates and times (taking
- timezones into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDateTime representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two dates and times are represent the same exact          point in time. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison on this and the supplied dates and times (taking
+ timezones into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDateTime representation of the date to compare to</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two dates and times are represent the same exact          point in time. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the date and time stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the date and time stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison on this and the supplied dates and times (taking timezones
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison on this and the supplied dates and times (taking timezones
  into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDateTime representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if in time, this date and time lies after the date and time          supplied. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_hour">hour</a></h2><p><code>public int <strong>hour</strong>()</code></p><p>Retrieve the hour from the date stored</p><h3>Returns</h3><p><code>int</code> - the hour value of the date stored</p><hr><h2><a name="method_is_digit">is_digit</a></h2><p><code>public boolean <strong>is_digit</strong>(char x)</code></p><p>Check to see if a character is numeric</p><h3>Parameters</h3><p><code>x</code> - Character to be tested</p><h3>Returns</h3><p><code>boolean</code> - True if the character is numeric. False otherwise.</p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison on this and the supplied dates and times (taking timezones
- into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDateTime representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if in time, this date and time lies before the date and time          supplied. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical minus operator between this XSDateTime and a supplied result
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison on this and the supplied dates and times (taking timezones
+ into account)</p><h3>Parameters</h3><p><code>arg</code> - XSDateTime representation of the date to compare to</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if in time, this date and time lies before the date and time          supplied. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical minus operator between this XSDateTime and a supplied result
  sequence (XSDateTime, XDTYearMonthDuration and XDTDayTimeDuration are
- only valid ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If this is an XSDateTime, the result will be a             XDTDayTimeDuration of the duration of time between these two             dates. If arg is an XDTYearMonthDuration or an             XDTDayTimeDuration the result will be a XSDateTime of the             result of the current date minus the duration of time             supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minute">minute</a></h2><p><code>public int <strong>minute</strong>()</code></p><p>Retrieve the minute from the date stored</p><h3>Returns</h3><p><code>int</code> - the minute value of the date stored</p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieve the month from the date stored</p><h3>Returns</h3><p><code>int</code> - the month value of the date stored</p><hr><h2><a name="method_pad_int">pad_int</a></h2><p><code>public java.lang.String <strong>pad_int</strong>(int num
+ only valid ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If this is an XSDateTime, the result will be a             XDTDayTimeDuration of the duration of time between these two             dates. If arg is an XDTYearMonthDuration or an             XDTDayTimeDuration the result will be a XSDateTime of the             result of the current date minus the duration of time             supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minute">minute</a></h2><p><code>public int <strong>minute</strong>()</code></p><p>Retrieve the minute from the date stored</p><h3>Returns</h3><p><code>int</code> - the minute value of the date stored</p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieve the month from the date stored</p><h3>Returns</h3><p><code>int</code> - the month value of the date stored</p><hr><h2><a name="method_pad_int">pad_int</a></h2><p><code>public java.lang.String <strong>pad_int</strong>(int num
          ,
       int len)</code></p><p>Pads the supplied number to the supplied number of digits by adding 0's
  in front of it</p><h3>Parameters</h3><p><code>num</code> - Number that si to be padded (if neccessay)</p><p><code>len</code> - Desired length after padding</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the padded integer</p><hr><h2><a name="method_parse_date">parse_date</a></h2><p><code>public int[] <strong>parse_date</strong>(java.lang.String str)</code></p><p>Parses a String representation of a date and time and retrieves the year,
  month and day from it</p><h3>Parameters</h3><p><code>str</code> - The String representation of the date (and optional timezone)</p><h3>Returns</h3><p><code>int[]</code> - Integer array of size 3. Element 1 is the year, element 2 is the          month and element 3 is the day</p><hr><h2><a name="method_parse_time">parse_time</a></h2><p><code>public double[] <strong>parse_time</strong>(java.lang.String str)</code></p><p>Parses a String representation of a date and time and retrieves the hour,
  minute and seconds from it</p><h3>Parameters</h3><p><code>str</code> - The String representation of the date (and optional timezone)</p><h3>Returns</h3><p><code>double[]</code> - Integer array of size 3. Element 1 is the hour, element 2 is the          minute and element 3 is the seconds</p><hr><h2><a name="method_parse_timezone">parse_timezone</a></h2><p><code>public int[] <strong>parse_timezone</strong>(java.lang.String str)</code></p><p>Parses a String representation of a date and time and retrieves the
  timezone from it</p><h3>Parameters</h3><p><code>str</code> - The String representation of the date (and optional timezone)</p><h3>Returns</h3><p><code>int[]</code> - Integer array of size 3. Element 1 represents whether the          timezone is ahead or behind GMT, element 2 is the hour          displacement and element 3 is the minute displacement.</p><hr><h2><a name="method_parseDateTime">parseDateTime</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime <strong>parseDateTime</strong>(java.lang.String str)</code></p><p>Parses a String representation of a date and time and constructs a new
- XSDateTime object using that information</p><h3>Parameters</h3><p><code>str</code> - The String representation of the date (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime</code> - The XSDateTime representation of the date and time (and optional          timezone)</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDateTime and a supplied
+ XSDateTime object using that information</p><h3>Parameters</h3><p><code>str</code> - The String representation of the date (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime</code> - The XSDateTime representation of the date and time (and optional          timezone)</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDateTime and a supplied
  result sequence (XDTYearMonthDuration and XDTDayTimeDuration are only
- valid ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If arg is an XDTYearMonthDuration or an             XDTDayTimeDuration the result will be a XSDateTime of the             result of the current date minus the duration of time             supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_second">second</a></h2><p><code>public double <strong>second</strong>()</code></p><p>Retrieve the seconds from the date stored</p><h3>Returns</h3><p><code>double</code> - the seconds value of the date stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrive the datatype full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:dateTime" which is the datatype full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the date and time stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the date and time stored</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype name</p><h3>Returns</h3><p><code>java.lang.String</code> - "dateTime" which is the dataype name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Currently unsupported method. Retrieves the date in milliseconds since
+ valid ones).</p><h3>Parameters</h3><p><code>arg</code> - The supplied ResultSequence that is on the right of the minus             operator. If arg is an XDTYearMonthDuration or an             XDTDayTimeDuration the result will be a XSDateTime of the             result of the current date minus the duration of time             supplied.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the result of the mathematical          minus operation.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_second">second</a></h2><p><code>public double <strong>second</strong>()</code></p><p>Retrieve the seconds from the date stored</p><h3>Returns</h3><p><code>double</code> - the seconds value of the date stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrive the datatype full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:dateTime" which is the datatype full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype name</p><h3>Returns</h3><p><code>java.lang.String</code> - "dateTime" which is the dataype name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Currently unsupported method. Retrieves the date in milliseconds since
  the begining of epoch</p><h3>Returns</h3><p><code>double</code> - Number of milliseconds since the begining of the epoch</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieve the year from the date stored</p><h3>Returns</h3><p><code>int</code> - the year value of the date stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration.html
index 68dae93..196b9e1 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration.html
@@ -8,25 +8,27 @@
          ,
       double seconds
          ,
-      boolean negative)</code></td></tr><tr><td><code><strong><a href="#con_XSDayTimeDuration">XSDayTimeDuration</a></strong>(double secs)</code></td></tr><tr><td><code><strong><a href="#con_XSDayTimeDuration">XSDayTimeDuration</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_clone">clone</a>()</code><br>
+      boolean negative)</code></td></tr><tr><td><code><strong><a href="#con_XSDayTimeDuration">XSDayTimeDuration</a></strong>(double secs)</code></td></tr><tr><td><code><strong><a href="#con_XSDayTimeDuration">XSDayTimeDuration</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSDayTimeDuration">XSDayTimeDuration</a></strong>(javax.xml.datatype.Duration d)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_clone">clone</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Creates a copy of this representation of a time duration</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Creates a copy of this representation of a time duration</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical division between this duration stored and the supplied
- duration of time (of type XSDayTimeDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ duration of time (of type XSDayTimeDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical subtraction between this duration stored and the supplied
  duration of time (of type XSDayTimeDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code></td><td width="" align="left"><code><a href="#method_parseDTDuration">parseDTDuration</a>(java.lang.String str)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new XSDayTimeDuration by parsing the supplied String
- represented duration of time</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ represented duration of time</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition between this duration stored and the supplied
  duration of time (of type XSDayTimeDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical multiplication between this duration stored and the supplied
  duration of time (of type XSDayTimeDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
@@ -43,11 +45,11 @@
          ,
       boolean negative)</code></p><p>Initialises to the supplied parameters. If more than 24 hours is
  supplied, the number of days is adjusted acordingly. The same occurs for
- minutes and seconds</p><hr><h2><a name="con_XSDayTimeDuration">XSDayTimeDuration</a></h2><p><code>public <strong>XSDayTimeDuration</strong>(double secs)</code></p><p>Initialises to the given number of seconds</p><hr><h2><a name="con_XSDayTimeDuration">XSDayTimeDuration</a></h2><p><code>public <strong>XSDayTimeDuration</strong>()</code></p><p>Initialises to a duration of no time (0days, 0hours, 0minutes, 0seconds)</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+ minutes and seconds</p><hr><h2><a name="con_XSDayTimeDuration">XSDayTimeDuration</a></h2><p><code>public <strong>XSDayTimeDuration</strong>(double secs)</code></p><p>Initialises to the given number of seconds</p><hr><h2><a name="con_XSDayTimeDuration">XSDayTimeDuration</a></h2><p><code>public <strong>XSDayTimeDuration</strong>()</code></p><p>Initialises to a duration of no time (0days, 0hours, 0minutes, 0seconds)</p><hr><h2><a name="con_XSDayTimeDuration">XSDayTimeDuration</a></h2><p><code>public <strong>XSDayTimeDuration</strong>(javax.xml.datatype.Duration d)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a copy of this representation of a time duration</p><h3>Returns</h3><p><code>java.lang.Object</code> - New XSDayTimeDuration representing the duration of time stored</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical division between this duration stored and the supplied
- duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to divide by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the division</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical subtraction between this duration stored and the supplied
- duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to subtract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the subtraction</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_parseDTDuration">parseDTDuration</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>parseDTDuration</strong>(java.lang.String str)</code></p><p>Creates a new XSDayTimeDuration by parsing the supplied String
- represented duration of time</p><h3>Parameters</h3><p><code>str</code> - String represented duration of time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - New XSDayTimeDuration representing the duration of time supplied</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition between this duration stored and the supplied
- duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to add</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the addition</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:dayTimeDuration" which is the datatype's full pathname</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical multiplication between this duration stored and the supplied
- duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to multiply by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the multiplication</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrives the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "dayTimeDuration" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a copy of this representation of a time duration</p><h3>Returns</h3><p><code>java.lang.Object</code> - New XSDayTimeDuration representing the duration of time stored</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical division between this duration stored and the supplied
+ duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to divide by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the division</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical subtraction between this duration stored and the supplied
+ duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to subtract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the subtraction</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_parseDTDuration">parseDTDuration</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>parseDTDuration</strong>(java.lang.String str)</code></p><p>Creates a new XSDayTimeDuration by parsing the supplied String
+ represented duration of time</p><h3>Parameters</h3><p><code>str</code> - String represented duration of time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - New XSDayTimeDuration representing the duration of time supplied</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition between this duration stored and the supplied
+ duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to add</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the addition</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:dayTimeDuration" which is the datatype's full pathname</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical multiplication between this duration stored and the supplied
+ duration of time (of type XSDayTimeDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to multiply by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSDayTimeDuration representing the resulting duration after          the multiplication</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrives the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "dayTimeDuration" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal.html
index 6362ad9..1675162 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal.html
@@ -4,29 +4,35 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Absolutes the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_ceiling">ceiling</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the smallest integer greater than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Returns the smallest integer greater than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new result sequence consisting of the retrievable decimal
- number in the supplied result sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
+ number in the supplied result sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical division operator between this XSDecimal and the supplied
  ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_double_value">double_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual value of the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_floor">floor</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.math.BigDecimal</code></td><td width="" align="left"><code><a href="#method_getValue">getValue</a>()</code><br>
+               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the Decimal value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.math.BigDecimal</code></td><td width="" align="left"><code><a href="#method_getValue">getValue</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_idiv">idiv</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_idiv">idiv</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical integer division operator between this XSDecimal and the
  supplied ResultSequence. Due to no numeric type promotion or conversion,
@@ -34,20 +40,24 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical subtraction operator between this XSDecimal and the supplied
- ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical modulus operator between this XSDecimal and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
- ResultSequence must be of type XSDecimal.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ ResultSequence must be of type XSDecimal.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition operator between this XSDecimal and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
- ResultSequence must be of type XSDecimal.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_round">round</a>()</code><br>
+ ResultSequence must be of type XSDecimal.</td></tr><tr valign="top"><td width="20%" align="right"><code>public static java.math.BigDecimal</code></td><td width="" align="left"><code><a href="#method_remainder">remainder</a>(java.math.BigDecimal value
+         ,
+      java.math.BigDecimal divisor)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_round">round</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Returns the closest integer of the number stored.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_round_half_to_even">round_half_to_even</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -57,14 +67,12 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Sets the number stored to that supplied</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the Decimal value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical multiplication operator between this XSDecimal and the
  supplied ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
+               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Negation of the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_zero">zero</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -72,20 +80,22 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSDecimal">XSDecimal</a></h2><p><code>public <strong>XSDecimal</strong>()</code></p><p>Initiates a representation of 0.0</p><hr><h2><a name="con_XSDecimal">XSDecimal</a></h2><p><code>public <strong>XSDecimal</strong>(java.math.BigDecimal x)</code></p><p>Initiates a representation of the supplied number</p><hr><h2><a name="con_XSDecimal">XSDecimal</a></h2><p><code>public <strong>XSDecimal</strong>(java.lang.String x)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the absolute value of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable decimal
- number in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the decimal number.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A new result sequence consisting of the decimal number supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical division operator between this XSDecimal and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_double_value">double_value</a></h2><p><code>public double <strong>double_value</strong>()</code></p><p>Retrieves the actual value of the number stored</p><h3>Returns</h3><p><code>double</code> - The actual value of the number stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at
+               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the absolute value of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable decimal
+ number in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the decimal number.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A new result sequence consisting of the decimal number supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.Item <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical division operator between this XSDecimal and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_double_value">double_value</a></h2><p><code>public double <strong>double_value</strong>()</code></p><p>Retrieves the actual value of the number stored</p><h3>Returns</h3><p><code>double</code> - The actual value of the number stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>at</code> - Representation to be compared with (must currently be of type             XSDecimal)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the 2 representation represent the same number. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_getValue">getValue</a></h2><p><code>public java.math.BigDecimal <strong>getValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.math.BigDecimal</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>at</code> - Representation to be compared with (must currently be of type             XSDecimal)</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the 2 representation represent the same number. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the Decimal value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the Decimal value stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getValue">getValue</a></h2><p><code>public java.math.BigDecimal <strong>getValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.math.BigDecimal</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDecimal)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number smaller than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_idiv">idiv</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>idiv</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical integer division operator between this XSDecimal and the
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDecimal)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number smaller than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_idiv">idiv</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>idiv</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical integer division operator between this XSDecimal and the
  supplied ResultSequence. Due to no numeric type promotion or conversion,
- the ResultSequence must be of type XSDecimal.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an integer division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSInteger consisting of the result of the mathematical integer          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_isLexicalValue">isLexicalValue</a></h2><p><code>protected boolean <strong>isLexicalValue</strong>(java.lang.String value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+ the ResultSequence must be of type XSDecimal.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an integer division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSInteger consisting of the result of the mathematical integer          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_isLexicalValue">isLexicalValue</a></h2><p><code>protected boolean <strong>isLexicalValue</strong>(java.lang.String value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDecimal)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number greater than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSDecimal and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSDecimal and the supplied
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDecimal)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number greater than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSDecimal and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSDecimal and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
- ResultSequence must be of type XSDecimal.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDecimal and the supplied
+ ResultSequence must be of type XSDecimal.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDecimal and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
- ResultSequence must be of type XSDecimal.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p>Returns the closest integer of the number stored with the specified precision.</p><h3>Parameters</h3><p><code>precision</code> - An integer precision</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the closest long of the number stored.</p><hr><h2><a name="method_set_double">set_double</a></h2><p><code>public void <strong>set_double</strong>(double x)</code></p><p>Sets the number stored to that supplied</p><h3>Parameters</h3><p><code>x</code> - Number to be stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:decimal" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the Decimal value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the Decimal value stored</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSDecimal and the
- supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          multiplication.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "decimal" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negation of the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDecimal representing the negation of this XSDecimal</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check if this XSDecimal represents 0</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDecimal represents 0. False otherwise</p><hr></body></html>
\ No newline at end of file
+ ResultSequence must be of type XSDecimal.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_remainder">remainder</a></h2><p><code>public java.math.BigDecimal <strong>remainder</strong>(java.math.BigDecimal value
+         ,
+      java.math.BigDecimal divisor)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><p><code>divisor</code></p><h3>Returns</h3><p><code>java.math.BigDecimal</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p>Returns the closest integer of the number stored with the specified precision.</p><h3>Parameters</h3><p><code>precision</code> - An integer precision</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDecimal representing the closest long of the number stored.</p><hr><h2><a name="method_set_double">set_double</a></h2><p><code>public void <strong>set_double</strong>(double x)</code></p><p>Sets the number stored to that supplied</p><h3>Parameters</h3><p><code>x</code> - Number to be stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:decimal" which is the datatype's full pathname</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSDecimal and the
+ supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDecimal consisting of the result of the mathematical          multiplication.</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "decimal" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negation of the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDecimal representing the negation of this XSDecimal</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check if this XSDecimal represents 0</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDecimal represents 0. False otherwise</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble.html
index 7703998..ee351b9 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble.html
@@ -4,41 +4,47 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Absolutes the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_ceiling">ceiling</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the smallest integer greater than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Returns the smallest integer greater than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new result sequence consisting of the retrievable double number
- in the supplied result sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
+ in the supplied result sequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical division operator between this XSDouble and the supplied
  ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_double_value">double_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual value of the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aa
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_floor">floor</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
-         ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_idiv">idiv</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the Decimal value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+         ,
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_idiv">idiv</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical integer division operator between this XSDouble and the
  supplied ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_infinite">infinite</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether this XSDouble represents an infinite number (negative or positive)</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between this number and the supplied representation. Currently
  no numeric type promotion exists so the supplied representation must be
- of type XSDouble.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ of type XSDouble.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical subtraction operator between this XSDouble and the supplied
- ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical modulus operator between this XSDouble and the supplied
  ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_nan">nan</a>()</code><br>
@@ -47,7 +53,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble</code></td><td width="" align="left"><code><a href="#method_parse_double">parse_double</a>(java.lang.String i)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Creates a new representation of the String represented number</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Creates a new representation of the String represented number</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition operator between this XSDouble and the supplied
  ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_round">round</a>()</code><br>
@@ -59,15 +65,13 @@
                Returns the closest integer of the number stored with the specified
  precision.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the Decimal value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical multiplication operator between this XSDouble and the
  supplied ResultSequence. Due to no numeric type promotion or conversion,
  the ResultSequence must be of type XSDouble.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
+               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Negation of the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_zero">zero</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -75,21 +79,21 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSDouble">XSDouble</a></h2><p><code>public <strong>XSDouble</strong>(double x)</code></p><p>Initialises a representation of the supplied number</p><hr><h2><a name="con_XSDouble">XSDouble</a></h2><p><code>public <strong>XSDouble</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSDouble">XSDouble</a></h2><p><code>public <strong>XSDouble</strong>(java.lang.String init)</code></p><p>Initialises using a String represented number</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the absolute value of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable double number
- in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the double number.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A new result sequence consisting of the double number supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical division operator between this XSDouble and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDouble consisting of the result of the mathematical division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_double_value">double_value</a></h2><p><code>public double <strong>double_value</strong>()</code></p><p>Retrieves the actual value of the number stored</p><h3>Returns</h3><p><code>double</code> - The actual value of the number stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aa
+               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the absolute value of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new result sequence consisting of the retrievable double number
+ in the supplied result sequence</p><h3>Parameters</h3><p><code>arg</code> - The result sequence from which to extract the double number.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A new result sequence consisting of the double number supplied.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.Item <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical division operator between this XSDouble and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDouble consisting of the result of the mathematical division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_double_value">double_value</a></h2><p><code>public double <strong>double_value</strong>()</code></p><p>Retrieves the actual value of the number stored</p><h3>Returns</h3><p><code>double</code> - The actual value of the number stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aa
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>aa</code> - Representation to be compared with (must currently be of type             XSDouble)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the 2 representations represent the same number. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>aa</code> - Representation to be compared with (must currently be of type             XSDouble)</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the 2 representations represent the same number. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the Decimal value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the Decimal value stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDouble)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number smaller than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_idiv">idiv</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>idiv</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical integer division operator between this XSDouble and the
- supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an integer division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSInteger consisting of the result of the mathematical integer          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_infinite">infinite</a></h2><p><code>public boolean <strong>infinite</strong>()</code></p><p>Check for whether this XSDouble represents an infinite number (negative or positive)</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDouble represents infinity. False otherwise.</p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDouble)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number smaller than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_idiv">idiv</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>idiv</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical integer division operator between this XSDouble and the
+ supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an integer division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSInteger consisting of the result of the mathematical integer          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_infinite">infinite</a></h2><p><code>public boolean <strong>infinite</strong>()</code></p><p>Check for whether this XSDouble represents an infinite number (negative or positive)</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDouble represents infinity. False otherwise.</p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation. Currently
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation. Currently
  no numeric type promotion exists so the supplied representation must be
- of type XSDouble.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDouble)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number greater than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSDouble and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDouble consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSDouble and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDouble consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_nan">nan</a></h2><p><code>public boolean <strong>nan</strong>()</code></p><p>Check for whether this XSDouble represents NaN</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDouble represents NaN. False otherwise.</p><hr><h2><a name="method_negativeZero">negativeZero</a></h2><p><code>public boolean <strong>negativeZero</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_parse_double">parse_double</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble <strong>parse_double</strong>(java.lang.String i)</code></p><p>Creates a new representation of the String represented number</p><h3>Parameters</h3><p><code>i</code> - String representation of the number to be stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble</code> - New XSDouble representing the number supplied</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDouble and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDouble consisting of the result of the mathematical addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p>Returns the closest integer of the number stored with the specified
- precision.</p><h3>Parameters</h3><p><code>precision</code> - An integer precision</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the closest long of the number stored.</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:double" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the Decimal value stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the Decimal value stored</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSDouble and the
+ of type XSDouble.</p><h3>Parameters</h3><p><code>arg</code> - Representation to be compared with (must currently be of type             XSDouble)</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied type represents a number greater than this          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSDouble and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDouble consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSDouble and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDouble consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_nan">nan</a></h2><p><code>public boolean <strong>nan</strong>()</code></p><p>Check for whether this XSDouble represents NaN</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDouble represents NaN. False otherwise.</p><hr><h2><a name="method_negativeZero">negativeZero</a></h2><p><code>public boolean <strong>negativeZero</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_parse_double">parse_double</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble <strong>parse_double</strong>(java.lang.String i)</code></p><p>Creates a new representation of the String represented number</p><h3>Parameters</h3><p><code>i</code> - String representation of the number to be stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble</code> - New XSDouble representing the number supplied</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSDouble and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDouble consisting of the result of the mathematical addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p>Returns the closest integer of the number stored with the specified
+ precision.</p><h3>Parameters</h3><p><code>precision</code> - An integer precision</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSDouble representing the closest long of the number stored.</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:double" which is the datatype's full pathname</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSDouble and the
  supplied ResultSequence. Due to no numeric type promotion or conversion,
- the ResultSequence must be of type XSDouble.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDouble consisting of the result of the mathematical          multiplication.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "double" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negation of the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSDouble representing the negation of this XSDecimal</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check for whether this XSDouble represents 0</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDouble represents 0. False otherwise.</p><hr></body></html>
\ No newline at end of file
+ the ResultSequence must be of type XSDouble.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDouble consisting of the result of the mathematical          multiplication.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "double" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negation of the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSDouble representing the negation of this XSDecimal</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check for whether this XSDouble represents 0</p><h3>Returns</h3><p><code>boolean</code> - True if this XSDouble represents 0. False otherwise.</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration.html
index f72fb92..610cebe 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration.html
@@ -29,18 +29,24 @@
          ,
       boolean negative)</code></td></tr><tr><td><code><strong><a href="#con_XSDuration">XSDuration</a></strong>(double secs)</code></td></tr><tr><td><code><strong><a href="#con_XSDuration">XSDuration</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_clone">clone</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable time duration
  from the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_days">days</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the number of days within the duration of time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Equality comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               Equality comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the duration stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_hours">hours</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -48,7 +54,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_minutes">minutes</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -66,9 +72,7 @@
                Retrieves the number of seconds (max 60) within the duration of time
  stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the duration stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_time_value">time_value</a>()</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_time_value">time_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -96,15 +100,15 @@
  supplied, the number of days is adjusted accordingly. The same occurs for
  minutes and seconds</p><hr><h2><a name="con_XSDuration">XSDuration</a></h2><p><code>public <strong>XSDuration</strong>(double secs)</code></p><p>Initialises to the given number of seconds</p><hr><h2><a name="con_XSDuration">XSDuration</a></h2><p><code>public <strong>XSDuration</strong>()</code></p><p>Initialises to a duration of no time (0days, 0hours, 0minutes, 0seconds)</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable time duration
- from the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the time duration extracted</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_days">days</a></h2><p><code>public int <strong>days</strong>()</code></p><p>Retrieves the number of days within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of days within the duration of time stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable time duration
+ from the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the time duration extracted</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_days">days</a></h2><p><code>public int <strong>days</strong>()</code></p><p>Retrieves the number of days within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of days within the duration of time stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if they both represent the duration of time. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if they both represent the duration of time. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the duration stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the duration stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a smaller duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_hours">hours</a></h2><p><code>public int <strong>hours</strong>()</code></p><p>Retrieves the number of hours (max 24) within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of hours within the duration of time stored</p><hr><h2><a name="method_isCastable">isCastable</a></h2><p><code>protected boolean <strong>isCastable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a smaller duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_hours">hours</a></h2><p><code>public int <strong>hours</strong>()</code></p><p>Retrieves the number of hours (max 24) within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of hours within the duration of time stored</p><hr><h2><a name="method_isCastable">isCastable</a></h2><p><code>protected boolean <strong>isCastable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a larger duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minutes">minutes</a></h2><p><code>public int <strong>minutes</strong>()</code></p><p>Retrieves the number of minutes (max 60) within the duration of time
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a larger duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minutes">minutes</a></h2><p><code>public int <strong>minutes</strong>()</code></p><p>Retrieves the number of minutes (max 60) within the duration of time
  stored</p><h3>Returns</h3><p><code>int</code> - Number of minutes within the duration of time stored</p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the number of months within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of months within the duration of time stored</p><hr><h2><a name="method_negative">negative</a></h2><p><code>public boolean <strong>negative</strong>()</code></p><p>Retrieves whether this duration represents a backward passage through
  time</p><h3>Returns</h3><p><code>boolean</code> - True if this duration represents a backward passage through time.          False otherwise</p><hr><h2><a name="method_parseDTDuration">parseDTDuration</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>parseDTDuration</strong>(java.lang.String str)</code></p><p>Creates a new XSDayTimeDuration by parsing the supplied String
  represented duration of time</p><h3>Parameters</h3><p><code>str</code> - String represented duration of time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - New XSDayTimeDuration representing the duration of time supplied</p><hr><h2><a name="method_seconds">seconds</a></h2><p><code>public double <strong>seconds</strong>()</code></p><p>Retrieves the number of seconds (max 60) within the duration of time
- stored</p><h3>Returns</h3><p><code>double</code> - Number of seconds within the duration of time stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the duration stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the duration stored</p><hr><h2><a name="method_time_value">time_value</a></h2><p><code>public double <strong>time_value</strong>()</code></p><p></p><h3>Returns</h3><p><code>double</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Retrieves the duration of time stored as the number of seconds within it</p><h3>Returns</h3><p><code>double</code> - Number of seconds making up this duration of time</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieves the number of years within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of years within the duration of time stored</p><hr></body></html>
\ No newline at end of file
+ stored</p><h3>Returns</h3><p><code>double</code> - Number of seconds within the duration of time stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_time_value">time_value</a></h2><p><code>public double <strong>time_value</strong>()</code></p><p></p><h3>Returns</h3><p><code>double</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Retrieves the duration of time stored as the number of seconds within it</p><h3>Returns</h3><p><code>double</code> - Number of seconds making up this duration of time</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieves the number of years within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of years within the duration of time stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSEntity.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSEntity.html
index ff3393d..51fdc17 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSEntity.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSEntity.html
@@ -1,12 +1,14 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSEntity</h2><br><hr><pre>public class <strong>XSEntity</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName</pre>Built in Data Type for xs:Entity<p></p><p></p><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSEntity">XSEntity</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSEntity">XSEntity</a></strong>(java.lang.String value)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName</pre>Built in Data Type for xs:Entity<p></p><p></p><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSEntity">XSEntity</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSEntity">XSEntity</a></strong>(java.lang.String value)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the ENTITY within
  the supplied ResultSequence.  The specification says that this
  is relaxed from the XML Schema requirement.  The ENTITY does
  not have to be located or expanded during construction and
- evaluation for casting.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ evaluation for casting.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -14,8 +16,8 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSEntity">XSEntity</a></h2><p><code>public <strong>XSEntity</strong>()</code></p><p></p><hr><h2><a name="con_XSEntity">XSEntity</a></h2><p><code>public <strong>XSEntity</strong>(java.lang.String value)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the ENTITY within
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the ENTITY within
  the supplied ResultSequence.  The specification says that this
  is relaxed from the XML Schema requirement.  The ENTITY does
  not have to be located or expanded during construction and
- evaluation for casting.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the ENTITY</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the ENTITY supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
+ evaluation for casting.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the ENTITY</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the ENTITY supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat.html
index 15a9ca8..ec109ca 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat.html
@@ -4,39 +4,45 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Absolutes the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_ceiling">ceiling</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the smallest integer greater than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Returns the smallest integer greater than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the retrievable float in the
- supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical division operator between this XSFloat and the supplied
  ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aa
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public float</code></td><td width="" align="left"><code><a href="#method_float_value">float_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual float value stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_floor">floor</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
-         ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+               Returns the largest integer smaller than the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_idiv">idiv</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the stored number</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+         ,
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_idiv">idiv</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical integer division operator between this XSFloat and the
  supplied ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_infinite">infinite</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether this datatype represents negative or positive infinity</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Comparison between this number and the supplied representation.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical subtraction operator between this XSFloat and the supplied
- ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical modulus operator between this XSFloat and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
@@ -44,7 +50,7 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether this datatype represents NaN</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_negativeZero">negativeZero</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition operator between this XSFloat and the supplied
  ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_round">round</a>()</code><br>
@@ -55,14 +61,12 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Returns the closest integer of the number stored with the specified precision.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the stored number</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical multiplication operator between this XSFloat and the
  supplied ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
+               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Negates the number stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_zero">zero</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -70,18 +74,18 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSFloat">XSFloat</a></h2><p><code>public <strong>XSFloat</strong>(float x)</code></p><p>Initiates a representation of the supplied number</p><hr><h2><a name="con_XSFloat">XSFloat</a></h2><p><code>public <strong>XSFloat</strong>()</code></p><p>Initiates a representation of 0</p><hr><h2><a name="con_XSFloat">XSFloat</a></h2><p><code>public <strong>XSFloat</strong>(java.lang.String init)</code></p><p>Initialises using a String represented number</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the absolute value of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the retrievable float in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the float</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the float supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical division operator between this XSFloat and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSFloat consisting of the result of the mathematical division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aa
+               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the absolute value of the number stored</p><hr><h2><a name="method_ceiling">ceiling</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>ceiling</strong>()</code></p><p>Returns the smallest integer greater than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the smallest integer greater than the          number stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the retrievable float in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the float</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the float supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.Item <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical division operator between this XSFloat and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSFloat consisting of the result of the mathematical division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType aa
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>aa</code> - The datatype to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same number. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_float_value">float_value</a></h2><p><code>public float <strong>float_value</strong>()</code></p><p>Retrieves the actual float value stored</p><h3>Returns</h3><p><code>float</code> - The actual float value stored</p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>aa</code> - The datatype to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same number. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_float_value">float_value</a></h2><p><code>public float <strong>float_value</strong>()</code></p><p>Retrieves the actual float value stored</p><h3>Returns</h3><p><code>float</code> - The actual float value stored</p><hr><h2><a name="method_floor">floor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>floor</strong>()</code></p><p>Returns the largest integer smaller than the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the largest integer smaller than the          number stored</p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the stored number</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored number</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - The datatype to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied representation is a smaller number than the          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_idiv">idiv</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>idiv</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical integer division operator between this XSFloat and the
- supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an integer division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSInteger consisting of the result of the mathematical integer          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_infinite">infinite</a></h2><p><code>public boolean <strong>infinite</strong>()</code></p><p>Check for whether this datatype represents negative or positive infinity</p><h3>Returns</h3><p><code>boolean</code> - True is this datatype represents infinity. False otherwise</p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - The datatype to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied representation is a smaller number than the          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_idiv">idiv</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>idiv</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical integer division operator between this XSFloat and the
+ supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an integer division with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSInteger consisting of the result of the mathematical integer          division.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_infinite">infinite</a></h2><p><code>public boolean <strong>infinite</strong>()</code></p><p>Check for whether this datatype represents negative or positive infinity</p><h3>Returns</h3><p><code>boolean</code> - True is this datatype represents infinity. False otherwise</p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - The datatype to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied representation is a greater number than the          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSFloat and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSFloat consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSFloat and the supplied
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this number and the supplied representation.</p><h3>Parameters</h3><p><code>arg</code> - The datatype to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied representation is a greater number than the          one stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSFloat and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSFloat consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSFloat and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
- ResultSequence must be of type XSFloat.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSFloat consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_nan">nan</a></h2><p><code>public boolean <strong>nan</strong>()</code></p><p>Check for whether this datatype represents NaN</p><h3>Returns</h3><p><code>boolean</code> - True is this datatype represents NaN. False otherwise</p><hr><h2><a name="method_negativeZero">negativeZero</a></h2><p><code>public boolean <strong>negativeZero</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSFloat and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSFloat consisting of the result of the mathematical addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p>Returns the closest integer of the number stored with the specified precision.</p><h3>Parameters</h3><p><code>precision</code> - An integer precision</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the closest long of the number stored.</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:float" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the stored number</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored number</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSFloat and the
- supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSFloat consisting of the result of the mathematical          multiplication.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "float" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negates the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSFloat representing the negation of the number stored</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check for whether this datatype represents 0</p><h3>Returns</h3><p><code>boolean</code> - True if this datatype represents 0. False otherwise</p><hr></body></html>
\ No newline at end of file
+ ResultSequence must be of type XSFloat.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSFloat consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_nan">nan</a></h2><p><code>public boolean <strong>nan</strong>()</code></p><p>Check for whether this datatype represents NaN</p><h3>Returns</h3><p><code>boolean</code> - True is this datatype represents NaN. False otherwise</p><hr><h2><a name="method_negativeZero">negativeZero</a></h2><p><code>public boolean <strong>negativeZero</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSFloat and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSFloat consisting of the result of the mathematical addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_round">round</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>()</code></p><p>Returns the closest integer of the number stored.</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the closest long of the number stored.</p><hr><h2><a name="method_round_half_to_even">round_half_to_even</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>round_half_to_even</strong>(int precision)</code></p><p>Returns the closest integer of the number stored with the specified precision.</p><h3>Parameters</h3><p><code>precision</code> - An integer precision</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - A XSFloat representing the closest long of the number stored.</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:float" which is the datatype's full pathname</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSFloat and the
+ supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSFloat consisting of the result of the mathematical          multiplication.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "float" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negates the number stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSFloat representing the negation of the number stored</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check for whether this datatype represents 0</p><h3>Returns</h3><p><code>boolean</code> - True if this datatype represents 0. False otherwise</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay.html
index ff61387..213bc74 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay.html
@@ -4,26 +4,28 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></td></tr><tr><td><code><strong><a href="#con_XSGDay">XSGDay</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Calendar</code></td><td width="" align="left"><code><a href="#method_calendar">calendar</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the Calendar representation of the day stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the Calendar representation of the day stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable gDay in the
  supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_day">day</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual day as an integer</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation. This
- representation must be of type XSGDay</td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
+ representation must be of type XSGDay</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the stored day</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay</code></td><td width="" align="left"><code><a href="#method_parse_gDay">parse_gDay</a>(java.lang.String str)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Parses a String representation of a day and constructs a new XSGDay
  representation of it.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the stored day</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether a timezone was specified at creation</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -35,9 +37,9 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initializes a representation of the supplied day</p><hr><h2><a name="con_XSGDay">XSGDay</a></h2><p><code>public <strong>XSGDay</strong>()</code></p><p>Initialises a representation of the current day</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the day stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the day stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gDay in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gDay is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the supplied day</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieves the actual day as an integer</p><h3>Returns</h3><p><code>int</code> - The actual day as an integer</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the day stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the day stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gDay in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gDay is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied day</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieves the actual day as an integer</p><h3>Returns</h3><p><code>int</code> - The actual day as an integer</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation. This
- representation must be of type XSGDay</p><h3>Parameters</h3><p><code>arg</code> - The XSGDay to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same day. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_parse_gDay">parse_gDay</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay <strong>parse_gDay</strong>(java.lang.String str)</code></p><p>Parses a String representation of a day and constructs a new XSGDay
- representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the day (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay</code> - The XSGDay representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gDay" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the stored day</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored day</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gDay" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation. This
+ representation must be of type XSGDay</p><h3>Parameters</h3><p><code>arg</code> - The XSGDay to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same day. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the stored day</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored day</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_parse_gDay">parse_gDay</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay <strong>parse_gDay</strong>(java.lang.String str)</code></p><p>Parses a String representation of a day and constructs a new XSGDay
+ representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the day (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay</code> - The XSGDay representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gDay" which is the datatype's full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gDay" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth.html
index 17b4d5c..a054481 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth.html
@@ -4,15 +4,19 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></td></tr><tr><td><code><strong><a href="#con_XSGMonth">XSGMonth</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Calendar</code></td><td width="" align="left"><code><a href="#method_calendar">calendar</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the Calendar representation of the month stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the Calendar representation of the month stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable gMonth in the
  supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation. This
- representation must be of type XSGMonth</td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
+ representation must be of type XSGMonth</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the stored month</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_month">month</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -21,9 +25,7 @@
                Parses a String representation of a month and constructs a new XSGMonth
  representation of it.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the stored month</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether a timezone was specified at creation</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -35,9 +37,9 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initializes a representation of the supplied month</p><hr><h2><a name="con_XSGMonth">XSGMonth</a></h2><p><code>public <strong>XSGMonth</strong>()</code></p><p>Initialises a representation of the current month</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the month stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the month stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gMonth in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gMonth is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the supplied month</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the month stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the month stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gMonth in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gMonth is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied month</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation. This
- representation must be of type XSGMonth</p><h3>Parameters</h3><p><code>arg</code> - The XSGMonth to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same month. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the actual month as an integer</p><h3>Returns</h3><p><code>int</code> - The actual month as an integer</p><hr><h2><a name="method_parse_gMonth">parse_gMonth</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth <strong>parse_gMonth</strong>(java.lang.String str)</code></p><p>Parses a String representation of a month and constructs a new XSGMonth
- representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the month (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth</code> - The XSGMonth representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gMonth" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the stored month</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored month</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gMonth" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation. This
+ representation must be of type XSGMonth</p><h3>Parameters</h3><p><code>arg</code> - The XSGMonth to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same month. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the stored month</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored month</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the actual month as an integer</p><h3>Returns</h3><p><code>int</code> - The actual month as an integer</p><hr><h2><a name="method_parse_gMonth">parse_gMonth</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth <strong>parse_gMonth</strong>(java.lang.String str)</code></p><p>Parses a String representation of a month and constructs a new XSGMonth
+ representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the month (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth</code> - The XSGMonth representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gMonth" which is the datatype's full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gMonth" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay.html
index e290aa6..0cc9f2b 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay.html
@@ -4,17 +4,21 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></td></tr><tr><td><code><strong><a href="#con_XSGMonthDay">XSGMonthDay</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Calendar</code></td><td width="" align="left"><code><a href="#method_calendar">calendar</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the Calendar representation of the month and day stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the Calendar representation of the month and day stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable gMonthDay in
  the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_day">day</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the actual day as an integer</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation. This
- representation must be of type XSGMonthDay</td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
+ representation must be of type XSGMonthDay</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the stored month and day</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_month">month</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -23,9 +27,7 @@
                Parses a String representation of a month and day and constructs a new
  XSGMonthDay representation of it.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the stored month and day</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether a timezone was specified at creation</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -37,9 +39,9 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initialises a representation of the supplied month and day</p><hr><h2><a name="con_XSGMonthDay">XSGMonthDay</a></h2><p><code>public <strong>XSGMonthDay</strong>()</code></p><p>Initialises a representation of the current month and day</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the month and day stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the month and day stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gMonthDay in
- the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gMonthDay is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the supplied month and day</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieves the actual day as an integer</p><h3>Returns</h3><p><code>int</code> - The actual day as an integer</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the month and day stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the month and day stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gMonthDay in
+ the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gMonthDay is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied month and day</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_day">day</a></h2><p><code>public int <strong>day</strong>()</code></p><p>Retrieves the actual day as an integer</p><h3>Returns</h3><p><code>int</code> - The actual day as an integer</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation. This
- representation must be of type XSGMonthDay</p><h3>Parameters</h3><p><code>arg</code> - The XSGMonthDay to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same month and day.          False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the actual month as an integer</p><h3>Returns</h3><p><code>int</code> - The actual month as an integer</p><hr><h2><a name="method_parse_gMonthDay">parse_gMonthDay</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay <strong>parse_gMonthDay</strong>(java.lang.String str)</code></p><p>Parses a String representation of a month and day and constructs a new
- XSGMonthDay representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the month and day (and optional             timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay</code> - The XSGMonthDay representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gMonthDay" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the stored month and day</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored month and day</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gMonthDay" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation. This
+ representation must be of type XSGMonthDay</p><h3>Parameters</h3><p><code>arg</code> - The XSGMonthDay to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same month and day.          False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the stored month and day</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored month and day</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the actual month as an integer</p><h3>Returns</h3><p><code>int</code> - The actual month as an integer</p><hr><h2><a name="method_parse_gMonthDay">parse_gMonthDay</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay <strong>parse_gMonthDay</strong>(java.lang.String str)</code></p><p>Parses a String representation of a month and day and constructs a new
+ XSGMonthDay representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the month and day (and optional             timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay</code> - The XSGMonthDay representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gMonthDay" which is the datatype's full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gMonthDay" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear.html
index a602587..b83a080 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear.html
@@ -4,24 +4,26 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></td></tr><tr><td><code><strong><a href="#con_XSGYear">XSGYear</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Calendar</code></td><td width="" align="left"><code><a href="#method_calendar">calendar</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the Calendar representation of the year stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the Calendar representation of the year stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable gYear in the
  supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation. This
- representation must be of type XSGYear</td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
+ representation must be of type XSGYear</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the stored year</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear</code></td><td width="" align="left"><code><a href="#method_parse_gYear">parse_gYear</a>(java.lang.String str)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Parses a String representation of a year and constructs a new XSGYear
  representation of it.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the stored year</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether a timezone was specified at creation</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -35,9 +37,9 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initialises a representation of the supplied month</p><hr><h2><a name="con_XSGYear">XSGYear</a></h2><p><code>public <strong>XSGYear</strong>()</code></p><p>Initialises a representation of the current year</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the year stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the year stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gYear in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gYear is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the supplied year</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the year stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the year stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gYear in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gYear is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied year</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation. This
- representation must be of type XSGYear</p><h3>Parameters</h3><p><code>arg</code> - The XSGYear to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same year. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_parse_gYear">parse_gYear</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear <strong>parse_gYear</strong>(java.lang.String str)</code></p><p>Parses a String representation of a year and constructs a new XSGYear
- representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the year (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear</code> - The XSGYear representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gYear" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the stored year</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored year</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gYear" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieves the actual year as an integer</p><h3>Returns</h3><p><code>int</code> - The actual year as an integer</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation. This
+ representation must be of type XSGYear</p><h3>Parameters</h3><p><code>arg</code> - The XSGYear to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same year. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the stored year</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored year</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_parse_gYear">parse_gYear</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear <strong>parse_gYear</strong>(java.lang.String str)</code></p><p>Parses a String representation of a year and constructs a new XSGYear
+ representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the year (and optional timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear</code> - The XSGYear representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gYear" which is the datatype's full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gYear" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieves the actual year as an integer</p><h3>Returns</h3><p><code>int</code> - The actual year as an integer</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth.html
index 90c2a69..9ca8d4d 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth.html
@@ -4,15 +4,19 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></td></tr><tr><td><code><strong><a href="#con_XSGYearMonth">XSGYearMonth</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.Calendar</code></td><td width="" align="left"><code><a href="#method_calendar">calendar</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the Calendar representation of the year and month stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the Calendar representation of the year and month stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable gYearMonth in
  the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation. This
- representation must be of type XSGYearMonth</td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
+ representation must be of type XSGYearMonth</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the stored year and month</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isGDataType">isGDataType</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_month">month</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -21,9 +25,7 @@
                Parses a String representation of a year and month and constructs a new
  XSGYearMonth representation of it.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the stored year and month</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether a timezone was specified at creation</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -37,9 +39,9 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initialises a representation of the supplied year and month</p><hr><h2><a name="con_XSGYearMonth">XSGYearMonth</a></h2><p><code>public <strong>XSGYearMonth</strong>()</code></p><p>Initialises a representation of the current year and month</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the year and month stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the year and month stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gYearMonth in
- the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gYearMonth is to be             extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the supplied year and month</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves the Calendar representation of the year and month stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the year and month stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable gYearMonth in
+ the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the gYearMonth is to be             extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied year and month</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation. This
- representation must be of type XSGYearMonth</p><h3>Parameters</h3><p><code>arg</code> - The XSGYearMonth to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same year and month.          False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the actual month as an integer</p><h3>Returns</h3><p><code>int</code> - The actual month as an integer</p><hr><h2><a name="method_parse_gYearMonth">parse_gYearMonth</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth <strong>parse_gYearMonth</strong>(java.lang.String str)</code></p><p>Parses a String representation of a year and month and constructs a new
- XSGYearMonth representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the year and month (and optional             timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth</code> - The XSGYearMonth representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gYearMonth" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the stored year and month</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored year and month</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gYearMonth" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieves the actual year as an integer</p><h3>Returns</h3><p><code>int</code> - The actual year as an integer</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation. This
+ representation must be of type XSGYearMonth</p><h3>Parameters</h3><p><code>arg</code> - The XSGYearMonth to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representations are of the same year and month.          False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the stored year and month</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the stored year and month</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isGDataType">isGDataType</a></h2><p><code>protected boolean <strong>isGDataType</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the actual month as an integer</p><h3>Returns</h3><p><code>int</code> - The actual month as an integer</p><hr><h2><a name="method_parse_gYearMonth">parse_gYearMonth</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth <strong>parse_gYearMonth</strong>(java.lang.String str)</code></p><p>Parses a String representation of a year and month and constructs a new
+ XSGYearMonth representation of it.</p><h3>Parameters</h3><p><code>str</code> - The String representation of the year and month (and optional             timezone)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth</code> - The XSGYearMonth representation of the supplied date</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:gYearMonth" which is the datatype's full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether a timezone was specified at creation</p><h3>Returns</h3><p><code>boolean</code> - True if a timezone was specified. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "gYearMonth" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the date stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - the timezone associated with the date stored</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieves the actual year as an integer</p><h3>Returns</h3><p><code>int</code> - The actual year as an integer</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSHexBinary.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSHexBinary.html
index 9603d32..1ffb820 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSHexBinary.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSHexBinary.html
@@ -1,18 +1,22 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSHexBinary</h2><br><hr><pre>public class <strong>XSHexBinary</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the xs:hexBinary datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSHexBinary">XSHexBinary</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSHexBinary">XSHexBinary</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the xs:hexBinary datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSHexBinary">XSHexBinary</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSHexBinary">XSHexBinary</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the hexBinary value</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation which
- must be of type hexBinary</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ must be of type hexBinary</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves a String representation of the base64Binary stored. This method is
- functionally identical to value()</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+ functionally identical to value()</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -21,9 +25,9 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSHexBinary">XSHexBinary</a></h2><p><code>public <strong>XSHexBinary</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSHexBinary">XSHexBinary</a></h2><p><code>public <strong>XSHexBinary</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the hexBinary value</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to construct hexBinary value</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence representing hexBinary value</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the hexBinary value</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to construct hexBinary value</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence representing hexBinary value</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation which
- must be of type hexBinary</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are same. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:hexBinary" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the base64Binary stored. This method is
- functionally identical to value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The hexBinary stored</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "hexBinary" which is the datatype's name</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.String <strong>value</strong>()</code></p><p>Retrieves a String representation of the hexBinary stored. This method is
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation which
+ must be of type hexBinary</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are same. False otherwise.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the base64Binary stored. This method is
+ functionally identical to value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The hexBinary stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:hexBinary" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "hexBinary" which is the datatype's name</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.String <strong>value</strong>()</code></p><p>Retrieves a String representation of the hexBinary stored. This method is
  functionally identical to string_value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The hexBinary stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSID.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSID.html
index d54a154..00988ce 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSID.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSID.html
@@ -1,6 +1,8 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSID</h2><br><hr><pre>public class <strong>XSID</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSID">XSID</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSID">XSID</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSID">XSID</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSID">XSID</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -10,4 +12,4 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSID">XSID</a></h2><p><code>public <strong>XSID</strong>(java.lang.String x)</code></p><p></p><hr><h2><a name="con_XSID">XSID</a></h2><p><code>public <strong>XSID</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSIDREF.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSIDREF.html
index 9c28726..8b05f62 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSIDREF.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSIDREF.html
@@ -1,6 +1,8 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSIDREF</h2><br><hr><pre>public class <strong>XSIDREF</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSIDREF">XSIDREF</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSIDREF">XSIDREF</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSIDREF">XSIDREF</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSIDREF">XSIDREF</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -10,4 +12,4 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSIDREF">XSIDREF</a></h2><p><code>public <strong>XSIDREF</strong>(java.lang.String x)</code></p><p></p><hr><h2><a name="con_XSIDREF">XSIDREF</a></h2><p><code>public <strong>XSIDREF</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt.html
index 57846be..771bf3c 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt.html
@@ -1,9 +1,11 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSInt</h2><br><hr><pre>public class <strong>XSInt</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSInt">XSInt</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSInt">XSInt</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSInt">XSInt</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSInt">XSInt</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable 'int' in the
- supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +13,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSInt">XSInt</a></h2><p><code>public <strong>XSInt</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSInt">XSInt</a></h2><p><code>public <strong>XSInt</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied int value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable 'int' in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the int is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'int' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:int" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "int" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable 'int' in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the int is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'int' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:int" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "int" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger.html
index 6c16af6..f74588a 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger.html
@@ -2,16 +2,20 @@
                Class XSInteger</h2><br><hr><pre>public class <strong>XSInteger</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal</pre>A representation of the Integer datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSInteger">XSInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSInteger">XSInteger</a></strong>(java.math.BigInteger x)</code></td></tr><tr><td><code><strong><a href="#con_XSInteger">XSInteger</a></strong>(java.lang.String x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code></td><td width="" align="left"><code><a href="#method_abs">abs</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Absolutes the integer stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Absolutes the integer stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable integer in the
- supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>protected org.eclipse.wst.xml.xpath2.api.Item</code></td><td width="" align="left"><code><a href="#method_convertArg">convertArg</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the integer stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.math.BigInteger</code></td><td width="" align="left"><code><a href="#method_int_value">int_value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -19,29 +23,27 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical subtraction operator between this XSInteger and the supplied
- ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_mod">mod</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical modulus operator between this XSInteger and the supplied
- ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition operator between this XSInteger and the supplied
  ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_set_int">set_int</a>(java.math.BigInteger x)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Sets the integer stored to that supplied</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the integer stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical multiplication operator between this XSInteger and the
  supplied ResultSequence.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
+               Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_unary_minus">unary_minus</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Negates the integer stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_zero">zero</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -49,13 +51,13 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSInteger">XSInteger</a></h2><p><code>public <strong>XSInteger</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSInteger">XSInteger</a></h2><p><code>public <strong>XSInteger</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied integer</p><hr><h2><a name="con_XSInteger">XSInteger</a></h2><p><code>public <strong>XSInteger</strong>(java.lang.String x)</code></p><p>Initializes a representation of the supplied integer</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the integer stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - New XSInteger representing the absolute of the integer stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable integer in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the integer is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the integer supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_abs">abs</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType <strong>abs</strong>()</code></p><p>Absolutes the integer stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType</code> - New XSInteger representing the absolute of the integer stored</p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable integer in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the integer is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the integer supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_convertArg">convertArg</a></h2><p><code>protected org.eclipse.wst.xml.xpath2.api.Item <strong>convertArg</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.Item</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the integer stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the integer stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_int_value">int_value</a></h2><p><code>public java.math.BigInteger <strong>int_value</strong>()</code></p><p>Retrieves the actual integer value stored</p><h3>Returns</h3><p><code>java.math.BigInteger</code> - The actual integer value stored</p><hr><h2><a name="method_isLexicalValue">isLexicalValue</a></h2><p><code>protected boolean <strong>isLexicalValue</strong>(java.lang.String value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_int_value">int_value</a></h2><p><code>public java.math.BigInteger <strong>int_value</strong>()</code></p><p>Retrieves the actual integer value stored</p><h3>Returns</h3><p><code>java.math.BigInteger</code> - The actual integer value stored</p><hr><h2><a name="method_isLexicalValue">isLexicalValue</a></h2><p><code>protected boolean <strong>isLexicalValue</strong>(java.lang.String value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSInteger and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSInteger consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSInteger and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSInteger consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSInteger and the supplied
- ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSInteger consisting of the result of the mathematical          addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_set_int">set_int</a></h2><p><code>public void <strong>set_int</strong>(java.math.BigInteger x)</code></p><p>Sets the integer stored to that supplied</p><h3>Parameters</h3><p><code>x</code> - Integer to be stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:integer" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the integer stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the integer stored</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSInteger and the
- supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSInteger consisting of the result of the mathematical          multiplication.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "integer" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negates the integer stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSInteger representing the negation of the integer stored</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check whether the integer represented is 0</p><h3>Returns</h3><p><code>boolean</code> - True is the integer represented is 0. False otherwise</p><hr></body></html>
\ No newline at end of file
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical subtraction operator between this XSInteger and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a subtraction with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSInteger consisting of the result of the mathematical          subtraction.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_mod">mod</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>mod</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical modulus operator between this XSInteger and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a modulus with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSInteger consisting of the result of the mathematical modulus.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition operator between this XSInteger and the supplied
+ ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform an addition with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSInteger consisting of the result of the mathematical          addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_set_int">set_int</a></h2><p><code>public void <strong>set_int</strong>(java.math.BigInteger x)</code></p><p>Sets the integer stored to that supplied</p><h3>Parameters</h3><p><code>x</code> - Integer to be stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:integer" which is the datatype's full pathname</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical multiplication operator between this XSInteger and the
+ supplied ResultSequence.</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence to perform a multiplication with</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSInteger consisting of the result of the mathematical          multiplication.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "integer" which is the datatype's name</p><hr><h2><a name="method_unary_minus">unary_minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>unary_minus</strong>()</code></p><p>Negates the integer stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSInteger representing the negation of the integer stored</p><hr><h2><a name="method_zero">zero</a></h2><p><code>public boolean <strong>zero</strong>()</code></p><p>Check whether the integer represented is 0</p><h3>Returns</h3><p><code>boolean</code> - True is the integer represented is 0. False otherwise</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong.html
index 0914d53..f6105a9 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong.html
@@ -1,9 +1,11 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSLong</h2><br><hr><pre>public class <strong>XSLong</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSLong">XSLong</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSLong">XSLong</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSLong">XSLong</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSLong">XSLong</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable long in the
- supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +13,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSLong">XSLong</a></h2><p><code>public <strong>XSLong</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSLong">XSLong</a></h2><p><code>public <strong>XSLong</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied long value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable long in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the long is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'long' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:long" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "long" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable long in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the long is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'long' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:long" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "long" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName.html
index f4e69e9..a940e13 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSNCName</h2><br><hr><pre>public class <strong>XSNCName</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSString</pre>A representation of the NCName datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNCName">XSNCName</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSNCName">XSNCName</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSName</pre>A representation of the NCName datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNCName">XSNCName</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSNCName">XSNCName</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable NCName within
- the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isConstraintSatisfied">isConstraintSatisfied</a>(java.lang.String strValue)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSNCName">XSNCName</a></h2><p><code>public <strong>XSNCName</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSNCName">XSNCName</a></h2><p><code>public <strong>XSNCName</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable NCName within
- the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the NCName</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the NCName supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:NCName" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "NCName" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable NCName within
+ the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the NCName</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the NCName supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isConstraintSatisfied">isConstraintSatisfied</a></h2><p><code>protected boolean <strong>isConstraintSatisfied</strong>(java.lang.String strValue)</code></p><p></p><h3>Parameters</h3><p><code>strValue</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:NCName" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "NCName" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNMTOKEN.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNMTOKEN.html
new file mode 100644
index 0000000..a40901f
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNMTOKEN.html
@@ -0,0 +1,17 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
+               Class XSNMTOKEN</h2><br><hr><pre>public class <strong>XSNMTOKEN</strong>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken</pre>A representation of the NMTOKEN datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNMTOKEN">XSNMTOKEN</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSNMTOKEN">XSNMTOKEN</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Creates a new ResultSequence consisting of the extractable NMTOKEN within
+ the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's name</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_XSNMTOKEN">XSNMTOKEN</a></h2><p><code>public <strong>XSNMTOKEN</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSNMTOKEN">XSNMTOKEN</a></h2><p><code>public <strong>XSNMTOKEN</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable NMTOKEN within
+ the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the NMTOKEN</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the NMTOKEN supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:NMTOKEN" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "NMTOKEN" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSName.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSName.html
new file mode 100644
index 0000000..3111039
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSName.html
@@ -0,0 +1,17 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
+               Class XSName</h2><br><hr><pre>public class <strong>XSName</strong>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken</pre>A representation of the Name datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSName">XSName</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSName">XSName</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Creates a new ResultSequence consisting of the extractable Name within
+ the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's name</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_XSName">XSName</a></h2><p><code>public <strong>XSName</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSName">XSName</a></h2><p><code>public <strong>XSName</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable Name within
+ the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the Name</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the Name supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:Name" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "Name" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger.html
index bf58344..c214ba8 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger.html
@@ -1,9 +1,11 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSNegativeInteger</h2><br><hr><pre>public class <strong>XSNegativeInteger</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNegativeInteger">XSNegativeInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSNegativeInteger">XSNegativeInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNegativeInteger">XSNegativeInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSNegativeInteger">XSNegativeInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable negativeInteger
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +13,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSNegativeInteger">XSNegativeInteger</a></h2><p><code>public <strong>XSNegativeInteger</strong>()</code></p><p>Initializes a representation of -1</p><hr><h2><a name="con_XSNegativeInteger">XSNegativeInteger</a></h2><p><code>public <strong>XSNegativeInteger</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied negativeInteger value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable negativeInteger
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the negativeInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'negativeInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:negativeInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "negativeInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable negativeInteger
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the negativeInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'negativeInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:negativeInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "negativeInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger.html
index 006748f..4dcf8ea 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSNonNegativeInteger</h2><br><hr><pre>public class <strong>XSNonNegativeInteger</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNonNegativeInteger">XSNonNegativeInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSNonNegativeInteger">XSNonNegativeInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNonNegativeInteger">XSNonNegativeInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSNonNegativeInteger">XSNonNegativeInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable nonNegativeInteger
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSNonNegativeInteger">XSNonNegativeInteger</a></h2><p><code>public <strong>XSNonNegativeInteger</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSNonNegativeInteger">XSNonNegativeInteger</a></h2><p><code>public <strong>XSNonNegativeInteger</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied nonNegativeInteger value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable nonNegativeInteger
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the nonNegativeInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'nonNegativeInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:nonNegativeInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "nonNegativeInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable nonNegativeInteger
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the nonNegativeInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'nonNegativeInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:nonNegativeInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "nonNegativeInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger.html
index 05919ce..b8a8bcf 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSNonPositiveInteger</h2><br><hr><pre>public class <strong>XSNonPositiveInteger</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNonPositiveInteger">XSNonPositiveInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSNonPositiveInteger">XSNonPositiveInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNonPositiveInteger">XSNonPositiveInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSNonPositiveInteger">XSNonPositiveInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable nonPositiveInteger
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSNonPositiveInteger">XSNonPositiveInteger</a></h2><p><code>public <strong>XSNonPositiveInteger</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSNonPositiveInteger">XSNonPositiveInteger</a></h2><p><code>public <strong>XSNonPositiveInteger</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied nonPositiveInteger value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable nonPositiveInteger
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the nonPositiveInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'nonPositiveInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:nonPositiveInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "nonPositiveInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable nonPositiveInteger
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the nonPositiveInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'nonPositiveInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:nonPositiveInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "nonPositiveInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString.html
new file mode 100644
index 0000000..c677b40
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString.html
@@ -0,0 +1,19 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
+               Class XSNormalizedString</h2><br><hr><pre>public class <strong>XSNormalizedString</strong>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSString</pre>A representation of the xs:normalizedString datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNormalizedString">XSNormalizedString</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSNormalizedString">XSNormalizedString</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Creates a new ResultSequence consisting of the extractable String in the
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isSatisfiesConstraints">isSatisfiesConstraints</a>(java.lang.String srcString)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's name</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_XSNormalizedString">XSNormalizedString</a></h2><p><code>public <strong>XSNormalizedString</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSNormalizedString">XSNormalizedString</a></h2><p><code>public <strong>XSNormalizedString</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable String in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the String</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied String</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isSatisfiesConstraints">isSatisfiesConstraints</a></h2><p><code>protected boolean <strong>isSatisfiesConstraints</strong>(java.lang.String srcString)</code></p><p></p><h3>Parameters</h3><p><code>srcString</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:normalizedString" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "normalizedString" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation.html
index a1faaa0..a98a398 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation.html
@@ -1,15 +1,19 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSNotation</h2><br><hr><pre>public class <strong>XSNotation</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNotation">XSNotation</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSNotation">XSNotation</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSNotation">XSNotation</a></h2><p><code>public <strong>XSNotation</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger.html
index 393829c..0f61774 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSPositiveInteger</h2><br><hr><pre>public class <strong>XSPositiveInteger</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSPositiveInteger">XSPositiveInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSPositiveInteger">XSPositiveInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSPositiveInteger">XSPositiveInteger</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSPositiveInteger">XSPositiveInteger</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable positiveInteger
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSPositiveInteger">XSPositiveInteger</a></h2><p><code>public <strong>XSPositiveInteger</strong>()</code></p><p>Initializes a representation of 1</p><hr><h2><a name="con_XSPositiveInteger">XSPositiveInteger</a></h2><p><code>public <strong>XSPositiveInteger</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied positiveInteger value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable positiveInteger
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the positiveInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'positiveInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:positiveInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "positiveInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable positiveInteger
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the positiveInteger is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'positiveInteger' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:positiveInteger" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "positiveInteger" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort.html
index 84881df..c736271 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSShort</h2><br><hr><pre>public class <strong>XSShort</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSShort">XSShort</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSShort">XSShort</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSShort">XSShort</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSShort">XSShort</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable 'short' in the
- supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSShort">XSShort</a></h2><p><code>public <strong>XSShort</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSShort">XSShort</a></h2><p><code>public <strong>XSShort</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied short value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable 'short' in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the short is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'short' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:short" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "short" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable 'short' in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the short is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'short' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:short" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "short" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSString.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSString.html
index e02fa93..4666420 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSString.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSString.html
@@ -1,29 +1,33 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSString</h2><br><hr><pre>public class <strong>XSString</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the String datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSString">XSString</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSString">XSString</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the String datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSString">XSString</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSString">XSString</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable String in the
  supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Equality comparison between this and the supplied representation which
- must be of type String</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+ must be of type String</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the string stored. This method is
+ functionally identical to value()</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between this and the supplied representation which must be of
  type String</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between this and the supplied representation which must be of
  type String</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the string stored. This method is
- functionally identical to value()</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's name</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -32,16 +36,16 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSString">XSString</a></h2><p><code>public <strong>XSString</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSString">XSString</a></h2><p><code>public <strong>XSString</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable String in the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the String</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the supplied String</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable String in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the String</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied String</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied representation which
- must be of type String</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are of the same String. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied representation which
+ must be of type String</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if the two representation are of the same String. False          otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the string stored. This method is
+ functionally identical to value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The String stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied representation which must be of
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied representation which must be of
  type String</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if this String is lexographically greater than that          supplied. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied representation which must be of
- type String</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if this String is lexographically less than that supplied.          False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:string" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the string stored. This method is
- functionally identical to value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The String stored</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "string" which is the datatype's name</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.String <strong>value</strong>()</code></p><p>Retrieves a String representation of the string stored. This method is
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied representation which must be of
+ type String</p><h3>Parameters</h3><p><code>arg</code> - The representation to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if this String is lexographically less than that supplied.          False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:string" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "string" which is the datatype's name</p><hr><h2><a name="method_value">value</a></h2><p><code>public java.lang.String <strong>value</strong>()</code></p><p>Retrieves a String representation of the string stored. This method is
  functionally identical to string_value()</p><h3>Returns</h3><p><code>java.lang.String</code> - The String stored</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime.html
index b065d36..36a9125 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime.html
@@ -6,24 +6,30 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves a Calendar representation of time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_clone">clone</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Creates a new copy of the time (and timezone) stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Creates a new copy of the time (and timezone) stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable time from the
  supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Equality comparison between this and the supplied XSTime representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               Equality comparison between this and the supplied XSTime representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between this and the supplied XSTime representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_hour">hour</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the hour stored as an integer</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison between this and the supplied XSTime representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Comparison between this and the supplied XSTime representation</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical subtraction between this time stored and the supplied
  representation. This supplied representation must be of either type
@@ -33,16 +39,14 @@
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the minute stored as an integer</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType</code></td><td width="" align="left"><code><a href="#method_parse_time">parse_time</a>(java.lang.String str)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Creates a new XSTime representing the String represented supplied time</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Creates a new XSTime representing the String represented supplied time</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition between this time stored and the supplied time
  duration.</td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_second">second</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the seconds stored as an integer</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_timezoned">timezoned</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Check for whether the time stored has a timezone associated with it</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -57,17 +61,17 @@
          ,
       org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)</code></p><p>Initialises to the supplied time and timezone</p><hr><h2><a name="con_XSTime">XSTime</a></h2><p><code>public <strong>XSTime</strong>()</code></p><p>Initialises to the current time</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves a Calendar representation of time stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the time stored</p><hr><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a new copy of the time (and timezone) stored</p><h3>Returns</h3><p><code>java.lang.Object</code> - New XSTime representing the copy of the time and timezone</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable time from the
- supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the supplied time</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_calendar">calendar</a></h2><p><code>public java.util.Calendar <strong>calendar</strong>()</code></p><p>Retrieves a Calendar representation of time stored</p><h3>Returns</h3><p><code>java.util.Calendar</code> - Calendar representation of the time stored</p><hr><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p>Creates a new copy of the time (and timezone) stored</p><h3>Returns</h3><p><code>java.lang.Object</code> - New XSTime representing the copy of the time and timezone</p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable time from the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied time</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied XSTime representation</p><h3>Parameters</h3><p><code>arg</code> - The XSTime to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if both XSTime's represent the same time. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied XSTime representation</p><h3>Parameters</h3><p><code>arg</code> - The XSTime to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if both XSTime's represent the same time. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the time stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the time stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied XSTime representation</p><h3>Parameters</h3><p><code>arg</code> - The XSTime to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represnts a point in time before that          represented by the time stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_hour">hour</a></h2><p><code>public int <strong>hour</strong>()</code></p><p>Retrieves the hour stored as an integer</p><h3>Returns</h3><p><code>int</code> - The hour stored</p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied XSTime representation</p><h3>Parameters</h3><p><code>arg</code> - The XSTime to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represnts a point in time before that          represented by the time stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_hour">hour</a></h2><p><code>public int <strong>hour</strong>()</code></p><p>Retrieves the hour stored as an integer</p><h3>Returns</h3><p><code>int</code> - The hour stored</p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied XSTime representation</p><h3>Parameters</h3><p><code>arg</code> - The XSTime to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represnts a point in time after that          represented by the time stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical subtraction between this time stored and the supplied
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied XSTime representation</p><h3>Parameters</h3><p><code>arg</code> - The XSTime to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represnts a point in time after that          represented by the time stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical subtraction between this time stored and the supplied
  representation. This supplied representation must be of either type
  XSTime (in which case the result is the duration of time between these
  two times) or a XSDayTimeDuration (in which case the result is the time
- when this duration is subtracted from the time stored).</p><h3>Parameters</h3><p><code>arg</code> - The representation to subtract (either XSTim or             XDTDayTimeDuration)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A ResultSequence representing the result of the subtraction</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minute">minute</a></h2><p><code>public int <strong>minute</strong>()</code></p><p>Retrieves the minute stored as an integer</p><h3>Returns</h3><p><code>int</code> - The minute stored</p><hr><h2><a name="method_parse_time">parse_time</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType <strong>parse_time</strong>(java.lang.String str)</code></p><p>Creates a new XSTime representing the String represented supplied time</p><h3>Parameters</h3><p><code>str</code> - String represented time and timezone to be stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType</code> - New XSTime representing the supplied time</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition between this time stored and the supplied time
- duration.</p><h3>Parameters</h3><p><code>arg</code> - A XDTDayTimeDuration representation of the duration of time to             add</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - A XSTime representing the result of this addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_second">second</a></h2><p><code>public double <strong>second</strong>()</code></p><p>Retrieves the seconds stored as an integer</p><h3>Returns</h3><p><code>double</code> - The second stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:time" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the time stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the time stored</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether the time stored has a timezone associated with it</p><h3>Returns</h3><p><code>boolean</code> - True if the time has a timezone associated. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "time" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the time stored as a duration of
+ when this duration is subtracted from the time stored).</p><h3>Parameters</h3><p><code>arg</code> - The representation to subtract (either XSTim or             XDTDayTimeDuration)</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A ResultSequence representing the result of the subtraction</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minute">minute</a></h2><p><code>public int <strong>minute</strong>()</code></p><p>Retrieves the minute stored as an integer</p><h3>Returns</h3><p><code>int</code> - The minute stored</p><hr><h2><a name="method_parse_time">parse_time</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType <strong>parse_time</strong>(java.lang.String str)</code></p><p>Creates a new XSTime representing the String represented supplied time</p><h3>Parameters</h3><p><code>str</code> - String represented time and timezone to be stored</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType</code> - New XSTime representing the supplied time</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition between this time stored and the supplied time
+ duration.</p><h3>Parameters</h3><p><code>arg</code> - A XDTDayTimeDuration representation of the duration of time to             add</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - A XSTime representing the result of this addition.</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_second">second</a></h2><p><code>public double <strong>second</strong>()</code></p><p>Retrieves the seconds stored as an integer</p><h3>Returns</h3><p><code>double</code> - The second stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:time" which is the datatype's full pathname</p><hr><h2><a name="method_timezoned">timezoned</a></h2><p><code>public boolean <strong>timezoned</strong>()</code></p><p>Check for whether the time stored has a timezone associated with it</p><h3>Returns</h3><p><code>boolean</code> - True if the time has a timezone associated. False otherwise</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "time" which is the datatype's name</p><hr><h2><a name="method_tz">tz</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>tz</strong>()</code></p><p>Retrieves the timezone associated with the time stored as a duration of
  time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - The duration of time between the time stored and the actual time          after the timezone is taken into account</p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Retrieves the time in milliseconds since the epoch</p><h3>Returns</h3><p><code>double</code> - time stored in milliseconds since the epoch</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken.html
new file mode 100644
index 0000000..ed11be7
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken.html
@@ -0,0 +1,19 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
+               Class XSToken</h2><br><hr><pre>public class <strong>XSToken</strong>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString</pre>A representation of the xs:token datatype<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSToken">XSToken</a></strong>(java.lang.String x)</code></td></tr><tr><td><code><strong><a href="#con_XSToken">XSToken</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Creates a new ResultSequence consisting of the extractable String in the
+ supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isSatisfiesConstraints">isSatisfiesConstraints</a>(java.lang.String srcString)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves the datatype's name</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_XSToken">XSToken</a></h2><p><code>public <strong>XSToken</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><h2><a name="con_XSToken">XSToken</a></h2><p><code>public <strong>XSToken</strong>()</code></p><p>Initialises to null</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable String in the
+ supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract the String</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the supplied String</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_isSatisfiesConstraints">isSatisfiesConstraints</a></h2><p><code>protected boolean <strong>isSatisfiesConstraints</strong>(java.lang.String srcString)</code></p><p></p><h3>Parameters</h3><p><code>srcString</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:token" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "token" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte.html
index 748aea1..0d46316 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSUnsignedByte</h2><br><hr><pre>public class <strong>XSUnsignedByte</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedByte">XSUnsignedByte</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedByte">XSUnsignedByte</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedByte">XSUnsignedByte</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedByte">XSUnsignedByte</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable unsignedByte
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSUnsignedByte">XSUnsignedByte</a></h2><p><code>public <strong>XSUnsignedByte</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSUnsignedByte">XSUnsignedByte</a></h2><p><code>public <strong>XSUnsignedByte</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied unsignedByte value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedByte
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedByte is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'unsignedByte' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedByte" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedByte" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedByte
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedByte is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'unsignedByte' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedByte" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedByte" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt.html
index 82b7220..0950dee 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSUnsignedInt</h2><br><hr><pre>public class <strong>XSUnsignedInt</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedInt">XSUnsignedInt</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedInt">XSUnsignedInt</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedInt">XSUnsignedInt</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedInt">XSUnsignedInt</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable unsignedInt
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSUnsignedInt">XSUnsignedInt</a></h2><p><code>public <strong>XSUnsignedInt</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSUnsignedInt">XSUnsignedInt</a></h2><p><code>public <strong>XSUnsignedInt</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied unsignedInt value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedInt
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedInt is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'unsignedInt' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedInt" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedInt" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedInt
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedInt is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'unsignedInt' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedInt" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedInt" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong.html
index 1c8a3aa..6febcc7 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSUnsignedLong</h2><br><hr><pre>public class <strong>XSUnsignedLong</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedLong">XSUnsignedLong</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedLong">XSUnsignedLong</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedLong">XSUnsignedLong</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedLong">XSUnsignedLong</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable unsignedLong
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSUnsignedLong">XSUnsignedLong</a></h2><p><code>public <strong>XSUnsignedLong</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSUnsignedLong">XSUnsignedLong</a></h2><p><code>public <strong>XSUnsignedLong</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied unsignedLong value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedLong
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedLong is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'unsignedLong' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedLong" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedLong" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedLong
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedLong is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'unsignedLong' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedLong" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedLong" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort.html
index 66b9a8d..94c2eae 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort.html
@@ -1,9 +1,13 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSUnsignedShort</h2><br><hr><pre>public class <strong>XSUnsignedShort</strong>
-extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedShort">XSUnsignedShort</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedShort">XSUnsignedShort</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUnsignedShort">XSUnsignedShort</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUnsignedShort">XSUnsignedShort</a></strong>(java.math.BigInteger x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable unsignedShort
- in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
+ in the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -11,5 +15,5 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSUnsignedShort">XSUnsignedShort</a></h2><p><code>public <strong>XSUnsignedShort</strong>()</code></p><p>Initializes a representation of 0</p><hr><h2><a name="con_XSUnsignedShort">XSUnsignedShort</a></h2><p><code>public <strong>XSUnsignedShort</strong>(java.math.BigInteger x)</code></p><p>Initializes a representation of the supplied unsignedShort value</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedShort
- in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedShort is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the 'unsignedShort' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedShort" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedShort" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable unsignedShort
+ in the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which the unsignedShort is to be extracted</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the 'unsignedShort' supplied</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:unsignedShort" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrieves the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "unsignedShort" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic.html
index 1cb196f..1109ea5 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic.html
@@ -1,18 +1,22 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
                Class XSUntypedAtomic</h2><br><hr><pre>public class <strong>XSUntypedAtomic</strong>
 extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the UntypedAtomic datatype which is used to represent
- untyped atomic nodes.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUntypedAtomic">XSUntypedAtomic</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUntypedAtomic">XSUntypedAtomic</a></strong>(java.lang.String x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ untyped atomic nodes.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSUntypedAtomic">XSUntypedAtomic</a></strong>()</code></td></tr><tr><td><code><strong><a href="#con_XSUntypedAtomic">XSUntypedAtomic</a></strong>(java.lang.String x)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_getNativeValue">getNativeValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the value of this untyped atomic
+ node</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the value of this untyped atomic
- node</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_XSUntypedAtomic">XSUntypedAtomic</a></h2><p><code>public <strong>XSUntypedAtomic</strong>()</code></p><p></p><hr><h2><a name="con_XSUntypedAtomic">XSUntypedAtomic</a></h2><p><code>public <strong>XSUntypedAtomic</strong>(java.lang.String x)</code></p><p>Initialises using the supplied String</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:untypedAtomic" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the value of this untyped atomic
- node</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the value of this untyped atomic node</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p></p><h3>Parameters</h3><p><code>arg</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getNativeValue">getNativeValue</a></h2><p><code>public java.lang.Object <strong>getNativeValue</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the value of this untyped atomic
+ node</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the value of this untyped atomic node</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:untypedAtomic" which is the datatype's full pathname</p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration.html
index b20ade3..112679d 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration.html
@@ -4,25 +4,29 @@
          ,
       int month
          ,
-      boolean negative)</code></td></tr><tr><td><code><strong><a href="#con_XSYearMonthDuration">XSYearMonthDuration</a></strong>(int months)</code></td></tr><tr><td><code><strong><a href="#con_XSYearMonthDuration">XSYearMonthDuration</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+      boolean negative)</code></td></tr><tr><td><code><strong><a href="#con_XSYearMonthDuration">XSYearMonthDuration</a></strong>(int months)</code></td></tr><tr><td><code><strong><a href="#con_XSYearMonthDuration">XSYearMonthDuration</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new ResultSequence consisting of the extractable time duration
- from the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ from the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_div">div</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical division between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Equality comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               Equality comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getStringValue">getStringValue</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               Retrieves a String representation of the duration of time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getTypeDefinition">getTypeDefinition</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_minus">minus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical subtraction between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_monthValue">monthValue</a>()</code><br>
@@ -33,14 +37,12 @@
  time</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code></td><td width="" align="left"><code><a href="#method_parseYMDuration">parseYMDuration</a>(java.lang.String str)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Creates a new XSYearMonthDuration by parsing the supplied String
- represented duration of time</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+ represented duration of time</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_plus">plus</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical addition between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
-               &nbsp;&nbsp;&nbsp;&nbsp;
-               Retrieves a String representation of the duration of time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
+               Retrieves the datatype's full pathname</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence</code></td><td width="" align="left"><code><a href="#method_times">times</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                Mathematical multiplication between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
@@ -54,17 +56,17 @@
       boolean negative)</code></p><p>Initialises using the supplied parameters. If the number of months
  supplied is more than 12, the number of years is adjusted accordingly.</p><hr><h2><a name="con_XSYearMonthDuration">XSYearMonthDuration</a></h2><p><code>public <strong>XSYearMonthDuration</strong>(int months)</code></p><p>Initialises to the given number of months</p><hr><h2><a name="con_XSYearMonthDuration">XSYearMonthDuration</a></h2><p><code>public <strong>XSYearMonthDuration</strong>()</code></p><p>Initialises to a duration of no time (0years and 0months)</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable time duration
- from the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the time duration extracted</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical division between this duration stored and the supplied
- duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to divide by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the division</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+               </h2></td></tr></table><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable time duration
+ from the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New ResultSequence consisting of the time duration extracted</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_div">div</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>div</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical division between this duration stored and the supplied
+ duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to divide by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the division</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if they both represent the duration of time. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)</code></p><p>Equality comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>dynamicContext</code></p><h3>Returns</h3><p><code>boolean</code> - True if they both represent the duration of time. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getStringValue">getStringValue</a></h2><p><code>public java.lang.String <strong>getStringValue</strong>()</code></p><p>Retrieves a String representation of the duration of time stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the duration of time stored</p><hr><h2><a name="method_getTypeDefinition">getTypeDefinition</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getTypeDefinition</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a smaller duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a smaller duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
          ,
-      org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a larger duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical subtraction between this duration stored and the supplied
- duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to subtract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the subtraction</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_monthValue">monthValue</a></h2><p><code>public int <strong>monthValue</strong>()</code></p><p>Retrieves the duration of time stored as the number of months within it</p><h3>Returns</h3><p><code>int</code> - Number of months making up this duration of time</p><hr><h2><a name="method_negative">negative</a></h2><p><code>public boolean <strong>negative</strong>()</code></p><p>Retrieves whether this duration represents a backward passage through
+      org.eclipse.wst.xml.xpath2.api.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a larger duration than that          stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minus">minus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>minus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical subtraction between this duration stored and the supplied
+ duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to subtract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the subtraction</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_monthValue">monthValue</a></h2><p><code>public int <strong>monthValue</strong>()</code></p><p>Retrieves the duration of time stored as the number of months within it</p><h3>Returns</h3><p><code>int</code> - Number of months making up this duration of time</p><hr><h2><a name="method_negative">negative</a></h2><p><code>public boolean <strong>negative</strong>()</code></p><p>Retrieves whether this duration represents a backward passage through
  time</p><h3>Returns</h3><p><code>boolean</code> - True if this duration represents a backward passage through time.          False otherwise</p><hr><h2><a name="method_parseYMDuration">parseYMDuration</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>parseYMDuration</strong>(java.lang.String str)</code></p><p>Creates a new XSYearMonthDuration by parsing the supplied String
- represented duration of time</p><h3>Parameters</h3><p><code>str</code> - String represented duration of time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - New XSYearMonthDuration representing the duration of time          supplied</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical addition between this duration stored and the supplied
- duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to add</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the addition</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:yearMonthDuration" which is the datatype's full pathname</p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the duration of time stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the duration of time stored</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Mathematical multiplication between this duration stored and the supplied
- duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to multiply by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the multiplication</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrives the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "yearMonthDuration" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
+ represented duration of time</p><h3>Parameters</h3><p><code>str</code> - String represented duration of time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - New XSYearMonthDuration representing the duration of time          supplied</p><hr><h2><a name="method_plus">plus</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>plus</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical addition between this duration stored and the supplied
+ duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to add</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the addition</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p>Retrieves the datatype's full pathname</p><h3>Returns</h3><p><code>java.lang.String</code> - "xs:yearMonthDuration" which is the datatype's full pathname</p><hr><h2><a name="method_times">times</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.ResultSequence <strong>times</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)</code></p><p>Mathematical multiplication between this duration stored and the supplied
+ duration of time (of type XSYearMonthDuration)</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to multiply by</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.ResultSequence</code> - New XSYearMonthDuration representing the resulting duration          after the multiplication</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p>Retrives the datatype's name</p><h3>Returns</h3><p><code>java.lang.String</code> - "yearMonthDuration" which is the datatype's name</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition.html
new file mode 100644
index 0000000..358602d
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition.html
@@ -0,0 +1,9 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font><br>
+               Class AtomicTypeDefinition</h2><br><hr><pre>public class <strong>AtomicTypeDefinition</strong>
+extends </pre><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></td><td width="" align="left"><code><a href="#method_construct">construct</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></td><td width="" align="left"><code><a href="#method_constructNative">constructNative</a>(java.lang.Object rs)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_construct">construct</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence <strong>construct</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></p><hr><h2><a name="method_constructNative">constructNative</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence <strong>constructNative</strong>(java.lang.Object rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition.html
new file mode 100644
index 0000000..5af3a59
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition.html
@@ -0,0 +1,21 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font><br>
+               Class BuiltinAtomicTypeDefinition</h2><br><hr><pre>public class <strong>BuiltinAtomicTypeDefinition</strong>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_BuiltinAtomicTypeDefinition">BuiltinAtomicTypeDefinition</a></strong>(java.lang.String name
+         ,
+      java.lang.Class implementationClass
+         ,
+      java.lang.Class nativeType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isAbstract">isAbstract</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_BuiltinAtomicTypeDefinition">BuiltinAtomicTypeDefinition</a></h2><p><code>public <strong>BuiltinAtomicTypeDefinition</strong>(java.lang.String name
+         ,
+      java.lang.Class implementationClass
+         ,
+      java.lang.Class nativeType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_isAbstract">isAbstract</a></h2><p><code>public boolean <strong>isAbstract</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition.html
new file mode 100644
index 0000000..e32f5e3
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition.html
@@ -0,0 +1,43 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font><br>
+               Class BuiltinListTypeDefinition</h2><br><hr><pre>public class <strong>BuiltinListTypeDefinition</strong>
+extends org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition</pre><hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_BuiltinListTypeDefinition">BuiltinListTypeDefinition</a></strong>(javax.xml.namespace.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition itemType)</code></td></tr><tr><td><code><strong><a href="#con_BuiltinListTypeDefinition">BuiltinListTypeDefinition</a></strong>(java.lang.String name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition itemType)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_getBounded">getBounded</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getBuiltInKind">getBuiltInKind</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_getFinite">getFinite</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getItemType">getItemType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getMemberTypes">getMemberTypes</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_getNumeric">getNumeric</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getOrdered">getOrdered</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition</code></td><td width="" align="left"><code><a href="#method_getPrimitiveType">getPrimitiveType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public short</code></td><td width="" align="left"><code><a href="#method_getVariety">getVariety</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isAbstract">isAbstract</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_BuiltinListTypeDefinition">BuiltinListTypeDefinition</a></h2><p><code>public <strong>BuiltinListTypeDefinition</strong>(javax.xml.namespace.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition itemType)</code></p><p></p><hr><h2><a name="con_BuiltinListTypeDefinition">BuiltinListTypeDefinition</a></h2><p><code>public <strong>BuiltinListTypeDefinition</strong>(java.lang.String name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition itemType)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_getBounded">getBounded</a></h2><p><code>public boolean <strong>getBounded</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getBuiltInKind">getBuiltInKind</a></h2><p><code>public short <strong>getBuiltInKind</strong>()</code></p><p></p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getFinite">getFinite</a></h2><p><code>public boolean <strong>getFinite</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getItemType">getItemType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getItemType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getMemberTypes">getMemberTypes</a></h2><p><code>public java.util.List <strong>getMemberTypes</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.util.List</code></p><hr><h2><a name="method_getNumeric">getNumeric</a></h2><p><code>public boolean <strong>getNumeric</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getOrdered">getOrdered</a></h2><p><code>public short <strong>getOrdered</strong>()</code></p><p></p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_getPrimitiveType">getPrimitiveType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition <strong>getPrimitiveType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition</code></p><hr><h2><a name="method_getVariety">getVariety</a></h2><p><code>public short <strong>getVariety</strong>()</code></p><p></p><h3>Returns</h3><p><code>short</code></p><hr><h2><a name="method_isAbstract">isAbstract</a></h2><p><code>public boolean <strong>isAbstract</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition.html
new file mode 100644
index 0000000..4381c9b
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition.html
@@ -0,0 +1,77 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font><br>
+               Class BuiltinTypeDefinition</h2><br><hr><pre>public class <strong>BuiltinTypeDefinition</strong>
+extends java.lang.Object</pre><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  java.lang.String</code></td><td width="80%" align="left"><code><a href="#field_XS_NS">XS_NS</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></strong>(javax.xml.namespace.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></td></tr><tr><td><code><strong><a href="#con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></strong>(java.lang.String name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></td></tr><tr><td><code><strong><a href="#con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></strong>(javax.xml.namespace.QName name
+         ,
+      java.lang.Class implementationClass
+         ,
+      java.lang.Class nativeType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></td></tr><tr><td><code><strong><a href="#con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></strong>(java.lang.String name
+         ,
+      java.lang.Class implementationClass
+         ,
+      java.lang.Class nativeType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></td><td width="" align="left"><code><a href="#method_construct">construct</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></td><td width="" align="left"><code><a href="#method_constructNative">constructNative</a>(java.lang.Object obj)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_derivedFrom">derivedFrom</a>(java.lang.String namespace
+         ,
+      java.lang.String name
+         ,
+      short derivationMethod)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_derivedFromType">derivedFromType</a>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition ancestorType
+         ,
+      short derivationMethod)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></td><td width="" align="left"><code><a href="#method_getBaseType">getBaseType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getName">getName</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_getNamespace">getNamespace</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Class</code></td><td width="" align="left"><code><a href="#method_getNativeType">getNativeType</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getSimpleTypes">getSimpleTypes</a>(org.w3c.dom.Attr attr)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public java.util.List</code></td><td width="" align="left"><code><a href="#method_getSimpleTypes">getSimpleTypes</a>(org.w3c.dom.Element attr)</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_isAbstract">isAbstract</a>()</code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_XS_NS">XS_NS</a></h2><p><code>public static  java.lang.String <strong>XS_NS</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></h2><p><code>public <strong>BuiltinTypeDefinition</strong>(javax.xml.namespace.QName name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></p><p></p><hr><h2><a name="con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></h2><p><code>public <strong>BuiltinTypeDefinition</strong>(java.lang.String name
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></p><p></p><hr><h2><a name="con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></h2><p><code>public <strong>BuiltinTypeDefinition</strong>(javax.xml.namespace.QName name
+         ,
+      java.lang.Class implementationClass
+         ,
+      java.lang.Class nativeType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></p><p></p><hr><h2><a name="con_BuiltinTypeDefinition">BuiltinTypeDefinition</a></h2><p><code>public <strong>BuiltinTypeDefinition</strong>(java.lang.String name
+         ,
+      java.lang.Class implementationClass
+         ,
+      java.lang.Class nativeType
+         ,
+      org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition baseType)</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Methods Detail
+               </h2></td></tr></table><h2><a name="method_construct">construct</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence <strong>construct</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence rs)</code></p><p></p><h3>Parameters</h3><p><code>rs</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></p><hr><h2><a name="method_constructNative">constructNative</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence <strong>constructNative</strong>(java.lang.Object obj)</code></p><p></p><h3>Parameters</h3><p><code>obj</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence</code></p><hr><h2><a name="method_derivedFrom">derivedFrom</a></h2><p><code>public boolean <strong>derivedFrom</strong>(java.lang.String namespace
+         ,
+      java.lang.String name
+         ,
+      short derivationMethod)</code></p><p></p><h3>Parameters</h3><p><code>namespace</code></p><p><code>name</code></p><p><code>derivationMethod</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_derivedFromType">derivedFromType</a></h2><p><code>public boolean <strong>derivedFromType</strong>(org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition ancestorType
+         ,
+      short derivationMethod)</code></p><p></p><h3>Parameters</h3><p><code>ancestorType</code></p><p><code>derivationMethod</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_getBaseType">getBaseType</a></h2><p><code>public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition <strong>getBaseType</strong>()</code></p><p></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition</code></p><hr><h2><a name="method_getName">getName</a></h2><p><code>public java.lang.String <strong>getName</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getNamespace">getNamespace</a></h2><p><code>public java.lang.String <strong>getNamespace</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_getNativeType">getNativeType</a></h2><p><code>public java.lang.Class <strong>getNativeType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_getSimpleTypes">getSimpleTypes</a></h2><p><code>public java.util.List <strong>getSimpleTypes</strong>(org.w3c.dom.Attr attr)</code></p><p></p><h3>Parameters</h3><p><code>attr</code></p><h3>Returns</h3><p><code>java.util.List</code></p><hr><h2><a name="method_getSimpleTypes">getSimpleTypes</a></h2><p><code>public java.util.List <strong>getSimpleTypes</strong>(org.w3c.dom.Element attr)</code></p><p></p><h3>Parameters</h3><p><code>attr</code></p><h3>Returns</h3><p><code>java.util.List</code></p><hr><h2><a name="method_isAbstract">isAbstract</a></h2><p><code>public boolean <strong>isAbstract</strong>()</code></p><p></p><h3>Returns</h3><p><code>boolean</code></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary.html
new file mode 100644
index 0000000..7e628b4
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary.html
@@ -0,0 +1,112 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font><br>
+               Class BuiltinTypeLibrary</h2><br><hr><pre>public class <strong>BuiltinTypeLibrary</strong>
+extends java.lang.Object</pre>This type captures all of the built-in XPath 2.0 types, as defined in F&O specification.
+ http://www.w3.org/TR/xquery-operators/#datatypes<hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel</code></td><td width="80%" align="left"><code><a href="#field_BUILTIN_TYPES">BUILTIN_TYPES</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_ANYATOMICTYPE">XS_ANYATOMICTYPE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_ANYSIMPLETYPE">XS_ANYSIMPLETYPE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_ANYTYPE">XS_ANYTYPE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_ANYURI">XS_ANYURI</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_BASE64BINARY">XS_BASE64BINARY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_BOOLEAN">XS_BOOLEAN</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_BYTE">XS_BYTE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_DATE">XS_DATE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_DATETIME">XS_DATETIME</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_DAYTIMEDURATION">XS_DAYTIMEDURATION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_DECIMAL">XS_DECIMAL</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_DOUBLE">XS_DOUBLE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_DURATION">XS_DURATION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_ENTITIES">XS_ENTITIES</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_ENTITY">XS_ENTITY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_FLOAT">XS_FLOAT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_GDAY">XS_GDAY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_GMONTH">XS_GMONTH</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_GMONTHDAY">XS_GMONTHDAY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_GYEAR">XS_GYEAR</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_GYEARMONTH">XS_GYEARMONTH</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_HEXBINARY">XS_HEXBINARY</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_ID">XS_ID</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_IDREF">XS_IDREF</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_IDREFS">XS_IDREFS</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_INT">XS_INT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_INTEGER">XS_INTEGER</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_LANGUAGE">XS_LANGUAGE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_LONG">XS_LONG</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NAME">XS_NAME</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NCNAME">XS_NCNAME</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NEGATIVEINTEGER">XS_NEGATIVEINTEGER</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NMTOKEN">XS_NMTOKEN</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NMTOKENS">XS_NMTOKENS</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NONNEGATIVEINTEGER">XS_NONNEGATIVEINTEGER</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NONPOSITIVEINTEGER">XS_NONPOSITIVEINTEGER</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NORMALIZEDSTRING">XS_NORMALIZEDSTRING</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_NOTATION">XS_NOTATION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_POSITIVEINTEGER">XS_POSITIVEINTEGER</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_QNAME">XS_QNAME</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_SHORT">XS_SHORT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_STRING">XS_STRING</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_TIME">XS_TIME</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_TOKEN">XS_TOKEN</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_UNSIGNEDBYTE">XS_UNSIGNEDBYTE</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_UNSIGNEDINT">XS_UNSIGNEDINT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_UNSIGNEDLONG">XS_UNSIGNEDLONG</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_UNSIGNEDSHORT">XS_UNSIGNEDSHORT</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_UNTYPED">XS_UNTYPED</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_UNTYPEDATOMIC">XS_UNTYPEDATOMIC</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition</code></td><td width="80%" align="left"><code><a href="#field_XS_YEARMONTHDURATION">XS_YEARMONTHDURATION</a></code><br>
+               &nbsp;&nbsp;&nbsp;&nbsp;
+               </td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_BuiltinTypeLibrary">BuiltinTypeLibrary</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Field Detail
+               </h2></td></tr></table><h2><a name="field_BUILTIN_TYPES">BUILTIN_TYPES</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel <strong>BUILTIN_TYPES</strong></code></p><hr><h2><a name="field_XS_ANYATOMICTYPE">XS_ANYATOMICTYPE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_ANYATOMICTYPE</strong></code></p><hr><h2><a name="field_XS_ANYSIMPLETYPE">XS_ANYSIMPLETYPE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition <strong>XS_ANYSIMPLETYPE</strong></code></p><hr><h2><a name="field_XS_ANYTYPE">XS_ANYTYPE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition <strong>XS_ANYTYPE</strong></code></p><hr><h2><a name="field_XS_ANYURI">XS_ANYURI</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_ANYURI</strong></code></p><hr><h2><a name="field_XS_BASE64BINARY">XS_BASE64BINARY</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_BASE64BINARY</strong></code></p><hr><h2><a name="field_XS_BOOLEAN">XS_BOOLEAN</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_BOOLEAN</strong></code></p><hr><h2><a name="field_XS_BYTE">XS_BYTE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_BYTE</strong></code></p><hr><h2><a name="field_XS_DATE">XS_DATE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_DATE</strong></code></p><hr><h2><a name="field_XS_DATETIME">XS_DATETIME</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_DATETIME</strong></code></p><hr><h2><a name="field_XS_DAYTIMEDURATION">XS_DAYTIMEDURATION</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_DAYTIMEDURATION</strong></code></p><hr><h2><a name="field_XS_DECIMAL">XS_DECIMAL</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_DECIMAL</strong></code></p><hr><h2><a name="field_XS_DOUBLE">XS_DOUBLE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_DOUBLE</strong></code></p><hr><h2><a name="field_XS_DURATION">XS_DURATION</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_DURATION</strong></code></p><hr><h2><a name="field_XS_ENTITIES">XS_ENTITIES</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition <strong>XS_ENTITIES</strong></code></p><hr><h2><a name="field_XS_ENTITY">XS_ENTITY</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_ENTITY</strong></code></p><hr><h2><a name="field_XS_FLOAT">XS_FLOAT</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_FLOAT</strong></code></p><hr><h2><a name="field_XS_GDAY">XS_GDAY</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_GDAY</strong></code></p><hr><h2><a name="field_XS_GMONTH">XS_GMONTH</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_GMONTH</strong></code></p><hr><h2><a name="field_XS_GMONTHDAY">XS_GMONTHDAY</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_GMONTHDAY</strong></code></p><hr><h2><a name="field_XS_GYEAR">XS_GYEAR</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_GYEAR</strong></code></p><hr><h2><a name="field_XS_GYEARMONTH">XS_GYEARMONTH</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_GYEARMONTH</strong></code></p><hr><h2><a name="field_XS_HEXBINARY">XS_HEXBINARY</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_HEXBINARY</strong></code></p><hr><h2><a name="field_XS_ID">XS_ID</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_ID</strong></code></p><hr><h2><a name="field_XS_IDREF">XS_IDREF</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_IDREF</strong></code></p><hr><h2><a name="field_XS_IDREFS">XS_IDREFS</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition <strong>XS_IDREFS</strong></code></p><hr><h2><a name="field_XS_INT">XS_INT</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_INT</strong></code></p><hr><h2><a name="field_XS_INTEGER">XS_INTEGER</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_INTEGER</strong></code></p><hr><h2><a name="field_XS_LANGUAGE">XS_LANGUAGE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_LANGUAGE</strong></code></p><hr><h2><a name="field_XS_LONG">XS_LONG</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_LONG</strong></code></p><hr><h2><a name="field_XS_NAME">XS_NAME</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NAME</strong></code></p><hr><h2><a name="field_XS_NCNAME">XS_NCNAME</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NCNAME</strong></code></p><hr><h2><a name="field_XS_NEGATIVEINTEGER">XS_NEGATIVEINTEGER</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NEGATIVEINTEGER</strong></code></p><hr><h2><a name="field_XS_NMTOKEN">XS_NMTOKEN</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NMTOKEN</strong></code></p><hr><h2><a name="field_XS_NMTOKENS">XS_NMTOKENS</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition <strong>XS_NMTOKENS</strong></code></p><hr><h2><a name="field_XS_NONNEGATIVEINTEGER">XS_NONNEGATIVEINTEGER</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NONNEGATIVEINTEGER</strong></code></p><hr><h2><a name="field_XS_NONPOSITIVEINTEGER">XS_NONPOSITIVEINTEGER</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NONPOSITIVEINTEGER</strong></code></p><hr><h2><a name="field_XS_NORMALIZEDSTRING">XS_NORMALIZEDSTRING</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NORMALIZEDSTRING</strong></code></p><hr><h2><a name="field_XS_NOTATION">XS_NOTATION</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_NOTATION</strong></code></p><hr><h2><a name="field_XS_POSITIVEINTEGER">XS_POSITIVEINTEGER</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_POSITIVEINTEGER</strong></code></p><hr><h2><a name="field_XS_QNAME">XS_QNAME</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_QNAME</strong></code></p><hr><h2><a name="field_XS_SHORT">XS_SHORT</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_SHORT</strong></code></p><hr><h2><a name="field_XS_STRING">XS_STRING</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_STRING</strong></code></p><hr><h2><a name="field_XS_TIME">XS_TIME</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_TIME</strong></code></p><hr><h2><a name="field_XS_TOKEN">XS_TOKEN</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_TOKEN</strong></code></p><hr><h2><a name="field_XS_UNSIGNEDBYTE">XS_UNSIGNEDBYTE</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_UNSIGNEDBYTE</strong></code></p><hr><h2><a name="field_XS_UNSIGNEDINT">XS_UNSIGNEDINT</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_UNSIGNEDINT</strong></code></p><hr><h2><a name="field_XS_UNSIGNEDLONG">XS_UNSIGNEDLONG</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_UNSIGNEDLONG</strong></code></p><hr><h2><a name="field_XS_UNSIGNEDSHORT">XS_UNSIGNEDSHORT</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_UNSIGNEDSHORT</strong></code></p><hr><h2><a name="field_XS_UNTYPED">XS_UNTYPED</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition <strong>XS_UNTYPED</strong></code></p><hr><h2><a name="field_XS_UNTYPEDATOMIC">XS_UNTYPEDATOMIC</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_UNTYPEDATOMIC</strong></code></p><hr><h2><a name="field_XS_YEARMONTHDURATION">XS_YEARMONTHDURATION</a></h2><p><code>public static  org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition <strong>XS_YEARMONTHDURATION</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
+                  Constructor Detail
+               </h2></td></tr></table><h2><a name="con_BuiltinTypeLibrary">BuiltinTypeLibrary</a></h2><p><code>public <strong>BuiltinTypeLibrary</strong>()</code></p><p></p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence.html
new file mode 100644
index 0000000..fbb17a4
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence.html
@@ -0,0 +1,3 @@
+<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types.builtin</strong></font><br>
+               Class SingleItemSequence</h2><br><hr><pre>public class <strong>SingleItemSequence</strong>
+extends </pre><hr><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.utils.TypePromoter.html b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.utils.TypePromoter.html
index 57b146a..508bffc 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.utils.TypePromoter.html
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/html/org.eclipse.wst.xml.xpath2.processor.internal.utils.TypePromoter.html
@@ -1,16 +1,16 @@
 <html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.utils</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.utils</strong></font><br>
                Class TypePromoter</h2><br><hr><pre>public class <strong>TypePromoter</strong>
-extends java.lang.Object</pre>Generic type promoter for handling subtype substitution and type promotions for functions and operators.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_TypePromoter">TypePromoter</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></td><td width="" align="left"><code><a href="#method_atomize">atomize</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at)</code><br>
+extends java.lang.Object</pre>Generic type promoter for handling subtype substitution and type promotions for functions and operators.<hr><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_TypePromoter">TypePromoter</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></td><td width="" align="left"><code><a href="#method_atomize">atomize</a>(org.eclipse.wst.xml.xpath2.api.Item at)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_checkCombination">checkCombination</a>(java.lang.Class newType)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_considerSequence">considerSequence</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence sequenceToConsider)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_considerSequence">considerSequence</a>(org.eclipse.wst.xml.xpath2.api.ResultSequence sequenceToConsider)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_considerType">considerType</a>(java.lang.Class typeToConsider)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_considerTypes">considerTypes</a>(java.util.Collection typesToConsider)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
-               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_considerValue">considerValue</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at)</code><br>
+               </td></tr><tr valign="top"><td width="20%" align="right"><code>public void</code></td><td width="" align="left"><code><a href="#method_considerValue">considerValue</a>(org.eclipse.wst.xml.xpath2.api.Item at)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
                </td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></td><td width="" align="left"><code><a href="#method_doPromote">doPromote</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType value)</code><br>
                &nbsp;&nbsp;&nbsp;&nbsp;
@@ -26,4 +26,4 @@
                   Constructor Detail
                </h2></td></tr></table><h2><a name="con_TypePromoter">TypePromoter</a></h2><p><code>public <strong>TypePromoter</strong>()</code></p><p></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
                   Methods Detail
-               </h2></td></tr></table><h2><a name="method_atomize">atomize</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>atomize</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at)</code></p><p></p><h3>Parameters</h3><p><code>at</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></p><hr><h2><a name="method_checkCombination">checkCombination</a></h2><p><code>protected boolean <strong>checkCombination</strong>(java.lang.Class newType)</code></p><p></p><h3>Parameters</h3><p><code>newType</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_considerSequence">considerSequence</a></h2><p><code>public void <strong>considerSequence</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence sequenceToConsider)</code></p><p></p><h3>Parameters</h3><p><code>sequenceToConsider</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_considerType">considerType</a></h2><p><code>public void <strong>considerType</strong>(java.lang.Class typeToConsider)</code></p><p></p><h3>Parameters</h3><p><code>typeToConsider</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_considerTypes">considerTypes</a></h2><p><code>public void <strong>considerTypes</strong>(java.util.Collection typesToConsider)</code></p><p></p><h3>Parameters</h3><p><code>typesToConsider</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_considerValue">considerValue</a></h2><p><code>public void <strong>considerValue</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at)</code></p><p></p><h3>Parameters</h3><p><code>at</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_doPromote">doPromote</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>doPromote</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTargetType">getTargetType</a></h2><p><code>public java.lang.Class <strong>getTargetType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_promote">promote</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>promote</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_setTargetType">setTargetType</a></h2><p><code>protected void <strong>setTargetType</strong>(java.lang.Class class1)</code></p><p></p><h3>Parameters</h3><p><code>class1</code></p><hr><h2><a name="method_substitute">substitute</a></h2><p><code>protected java.lang.Class <strong>substitute</strong>(java.lang.Class typeToConsider)</code></p><p></p><h3>Parameters</h3><p><code>typeToConsider</code> - The</p><h3>Returns</h3><p><code>java.lang.Class</code> - The supertype to treat it as (i.e. if a xs:nonNegativeInteger is treated as xs:number)</p><hr></body></html>
\ No newline at end of file
+               </h2></td></tr></table><h2><a name="method_atomize">atomize</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>atomize</strong>(org.eclipse.wst.xml.xpath2.api.Item at)</code></p><p></p><h3>Parameters</h3><p><code>at</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></p><hr><h2><a name="method_checkCombination">checkCombination</a></h2><p><code>protected boolean <strong>checkCombination</strong>(java.lang.Class newType)</code></p><p></p><h3>Parameters</h3><p><code>newType</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_considerSequence">considerSequence</a></h2><p><code>public void <strong>considerSequence</strong>(org.eclipse.wst.xml.xpath2.api.ResultSequence sequenceToConsider)</code></p><p></p><h3>Parameters</h3><p><code>sequenceToConsider</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_considerType">considerType</a></h2><p><code>public void <strong>considerType</strong>(java.lang.Class typeToConsider)</code></p><p></p><h3>Parameters</h3><p><code>typeToConsider</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_considerTypes">considerTypes</a></h2><p><code>public void <strong>considerTypes</strong>(java.util.Collection typesToConsider)</code></p><p></p><h3>Parameters</h3><p><code>typesToConsider</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_considerValue">considerValue</a></h2><p><code>public void <strong>considerValue</strong>(org.eclipse.wst.xml.xpath2.api.Item at)</code></p><p></p><h3>Parameters</h3><p><code>at</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_doPromote">doPromote</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>doPromote</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_getTargetType">getTargetType</a></h2><p><code>public java.lang.Class <strong>getTargetType</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Class</code></p><hr><h2><a name="method_promote">promote</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType <strong>promote</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType value)</code></p><p></p><h3>Parameters</h3><p><code>value</code></p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType</code></p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_setTargetType">setTargetType</a></h2><p><code>protected void <strong>setTargetType</strong>(java.lang.Class class1)</code></p><p></p><h3>Parameters</h3><p><code>class1</code></p><hr><h2><a name="method_substitute">substitute</a></h2><p><code>protected java.lang.Class <strong>substitute</strong>(java.lang.Class typeToConsider)</code></p><p></p><h3>Parameters</h3><p><code>typeToConsider</code> - The</p><h3>Returns</h3><p><code>java.lang.Class</code> - The supertype to treat it as (i.e. if a xs:nonNegativeInteger is treated as xs:number)</p><hr></body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/jel.xml b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/jel.xml
index 7b5e490..98c6189 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/jel.xml
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/doc/jel.xml
@@ -1,12 +1,1608 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jel>
-	<admin creation="Mon Apr 12 15:41:44 PDT 2010" xsdversion="1.0.0" version="1.0.0" />
+	<admin creation="Thu May 19 00:54:27 CEST 2011" xsdversion="1.0.0" version="1.0.0" />
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.AtomicItemType" type="AtomicItemType">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+		</implements>
+		<comment>
+			<description>Defines an sequence or item of atomic types.</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getTypeDefinition" returncomment="The Schema type of the sequence or item." fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>Returns the schema type of the sequence or type.</description>
+					<attribute name="@return">
+						<description>The Schema type of the sequence or item.</description>
+					</attribute>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.CollationProvider" type="CollationProvider">
+		<comment>
+			<description>Service provider interface for looking up collations from within the
+ dynamic context.
+ 
+ Definition from the XPath2 specification: A collation is a specification of
+ the manner in which strings and URIs are compared and, by extension,
+ ordered. For a more complete definition of collation, see [XQuery 1.0 and
+ XPath 2.0 Functions and Operators (Second Edition)].</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field final="true" static="true" const="http://www.w3.org/2005/xpath-functions/collation/codepoint" visibility="public" name="CODEPOINT_COLLATION" constexpr="&quot;http://www.w3.org/2005/xpath-functions/collation/codepoint&quot;" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>The default collation which is guaranteed to always be implemented</description>
+				</comment>
+			</field>
+		</fields>
+		<methods>
+			<method visibility="public" name="getCollation" returncomment="The collation to use, or null if no such collation exists by
+         this provider" fulltype="java.util.Comparator" type="Comparator">
+				<comment>
+					<description>Gets the named collator. W3C does not define collation names (yet?) so
+ we are constrained to using an implementation-defined naming scheme.</description>
+					<attribute name="@param">
+						<description>name
+            A URI designating the collation to use</description>
+					</attribute>
+					<attribute name="@return">
+						<description>The collation to use, or null if no such collation exists by
+         this provider</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="name" comment="A URI designating the collation to use" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getDefaultCollation" fulltype="java.lang.String" type="String" />
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext">
+		<comment>
+			<description>Interface for dynamic context. This covers the Dynamic Context as defined by the XPath2 specification, EXCEPT for 
+ context item and size (handled in EvaluationContext)</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getLimitNode" returncomment="DOM node which limits axis navigation." fulltype="org.w3c.dom.Node" type="Node">
+				<comment>
+					<description>Returns a &quot;top&quot; node which the XPath2 engine is not allowed to
+ leave</description>
+					<attribute name="@return">
+						<description>DOM node which limits axis navigation.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getVariable" returncomment="variable." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<description>Get variable.</description>
+					<attribute name="@param">
+						<description>name
+            is the name of the variable.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>variable.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="name" comment="is the name of the variable." fulltype="javax.xml.namespace.QName" type="QName" />
+				</params>
+			</method>
+			<method visibility="public" name="resolveUri" returncomment="the absolutized, resolved URI." fulltype="java.net.URI" type="URI">
+				<comment>
+					<description>Resolve an URI</description>
+					<attribute name="@param">
+						<description>uri
+            is the possibly relative URI to resolve</description>
+					</attribute>
+					<attribute name="@return">
+						<description>the absolutized, resolved URI.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="uri" comment="is the possibly relative URI to resolve" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getCurrentDateTime" returncomment="The current date and time, which will always be same for the dynamic context." fulltype="java.util.GregorianCalendar" type="GregorianCalendar">
+				<comment>
+					<description>[Definition: Current dateTime. This
+ information represents an implementation-dependent point in time during
+ the processing of an expression, and includes an explicit timezone. It
+ can be retrieved by the fn:current-dateTime function. If invoked
+ multiple times during the execution of an expression, this function
+ always returns the same result.]
+
+ Returns the current date time using the GregorianCalendar.</description>
+					<attribute name="@return">
+						<description>The current date and time, which will always be same for the dynamic context.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getTimezoneOffset" returncomment="current date time and implicit timezone." fulltype="javax.xml.datatype.Duration" type="Duration">
+				<comment>
+					<description>[Definition: Implicit timezone. This
+ is the timezone to be used when a date, time, or dateTime value that
+ does not have a timezone is used in a comparison or arithmetic
+ operation. The implicit timezone is an implementation-defined value of
+ type xs:dayTimeDuration. See [XML Schema] for the range of legal values
+ of a timezone.]</description>
+					<attribute name="@return">
+						<description>current date time and implicit timezone.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getDocument" returncomment="document." fulltype="org.w3c.dom.Document" type="Document">
+				<comment>
+					<description>[Definition: Available documents. This is a mapping of
+ strings onto document nodes. The string represents the absolute URI of
+ a resource. The document node is the root of a tree that represents
+ that resource using the data model. The document node is returned by
+ the fn:doc function when applied to that URI.] The set of available
+ documents is not limited to the set of statically known documents, and
+ it may be empty. If there are one or more URIs in available documents
+ that map to a document node D, then the document-uri property of D must
+ either be absent, or must be one of these URIs. Note: This means that
+ given a document node $N, the result of fn:doc(fn:document-uri($N)) is
+ $N will always be True, unless fn:document-uri($N) is an empty
+ sequence.</description>
+					<attribute name="@param">
+						<description>uri
+            is the URI of the document.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>document.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="uri" comment="is the URI of the document." fulltype="java.net.URI" type="URI" />
+				</params>
+			</method>
+			<method visibility="public" name="getCollections" fulltype="java.util.Map" type="Map">
+				<comment>
+					<description>[Definition: Available collections. This is a mapping of
+ strings onto sequences of nodes. The string represents the absolute URI
+ of a resource. The sequence of nodes represents the result of the
+ fn:collection function when that URI is supplied as the argument. ] The
+ set of available collections is not limited to the set of statically
+ known collections, and it may be empty. For every document node D that
+ is in the target of a mapping in available collections, or that is the
+ root of a tree containing such a node, the document-uri property of D
+ must either be absent, or must be a URI U such that available documents
+ contains a mapping from U to D.&quot; Note: This means that for any document
+ node $N retrieved using the fn:collection function, either directly or
+ by navigating to the root of a node that was returned, the result of
+ fn:doc(fn:document-uri($N)) is $N will always be True, unless
+ fn:document-uri($N) is an empty sequence. This implies a requirement
+ for the fn:doc and fn:collection functions to be consistent in their
+ effect. If the implementation uses catalogs or user-supplied URI
+ resolvers to dereference URIs supplied to the fn:doc function, the
+ implementation of the fn:collection function must take these mechanisms
+ into account. For example, an implementation might achieve this by
+ mapping the collection URI to a set of document URIs, which are then
+ resolved using the same catalog or URI resolver that is used by the
+ fn:doc function.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getDefaultCollection" fulltype="java.util.List" type="List">
+				<comment>
+					<description>[Definition: Default collection. This is the sequence
+ of nodes that would result from calling the fn:collection function with
+ no arguments.] The value of default collection may be initialized by
+ the implementation.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getCollationProvider" fulltype="org.eclipse.wst.xml.xpath2.api.CollationProvider" type="CollationProvider">
+				<comment>
+					<description>Actual collation providers available for use dynamically. This could
+ differ from the collations available statically, but would give
+ unexpected results.</description>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.EvaluationContext" type="EvaluationContext">
+		<comment>
+			<attribute name="@noimplement">
+				<description>This interface is not intended to be implemented by clients.</description>
+			</attribute>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getContextItem" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<comment>
+					<description>Definition: The context item is the item currently being processed. An
+ item is either an atomic value or a node.
+ Definition: When the context
+ item is a node, it can also be referred to as the context node.
+ 
+ The
+ context item is returned by an expression consisting of a single dot
+ (.). When an expression E1/E2 or E1[E2] is evaluated, each item in the
+ sequence obtained by evaluating E1 becomes the context item in the
+ inner focus for an evaluation of E2.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getContextPosition" fulltype="int" type="int">
+				<comment>
+					<description>[Definition: The context position
+ is the position of the context item within the sequence of items
+ currently being processed.] It changes whenever the context item
+ changes. When the focus is defined, the value of the context position
+ is an integer greater than zero. The context position is returned by
+ the expression fn:position(). When an expression E1/E2 or E1[E2] is
+ evaluated, the context position in the inner focus for an evaluation of
+ E2 is the position of the context item in the sequence obtained by
+ evaluating E1. The position of the first item in a sequence is always 1
+ (one). The context position is always less than or equal to the context
+ size.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getLastPosition" fulltype="int" type="int">
+				<comment>
+					<description>[Definition: The context size is the number of items in the
+ sequence of items currently being processed.] Its value is always an
+ integer greater than zero. The context size is returned by the
+ expression fn:last(). When an expression E1/E2 or E1[E2] is evaluated,
+ the context size in the inner focus for an evaluation of E2 is the
+ number of items in the sequence obtained by evaluating E1. [Definition:
+ Variable values. This is a set of (expanded QName, value) pairs. It
+ contains the same expanded QNames as the in-scope variables in the
+ static context for the expression. The expanded QName is the name of
+ the variable and the value is the dynamic value of the variable, which
+ includes its dynamic type.]</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getDynamicContext" returncomment="The current dynamic context in effect." fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext">
+				<comment>
+					<attribute name="@return">
+						<description>The current dynamic context in effect.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getStaticContext" returncomment="The current static context in effect." fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext">
+				<comment>
+					<attribute name="@return">
+						<description>The current static context in effect.</description>
+					</attribute>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function">
+		<comment>
+			<description>Support for functions.</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getName" returncomment="Result of QName operation." fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Support for QName interface.</description>
+					<attribute name="@return">
+						<description>Result of QName operation.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getMinArity" returncomment="The smallest number of arguments possible" fulltype="int" type="int">
+				<comment>
+					<description>Minimal number of allowed arguments.</description>
+					<attribute name="@return">
+						<description>The smallest number of arguments possible</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getMaxArity" returncomment="The highest number of arguments possible" fulltype="int" type="int">
+				<comment>
+					<description>Maximum number of allowed arguments.</description>
+					<attribute name="@return">
+						<description>The highest number of arguments possible</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="isVariableArgument" returncomment="The highest number of arguments possible" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Maximum number of allowed arguments.</description>
+					<attribute name="@return">
+						<description>The highest number of arguments possible</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="canMatchArity" returncomment="" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Checks if this function has an to the</description>
+					<attribute name="@param">
+						<description>actual_arity</description>
+					</attribute>
+					<attribute name="@return" />
+				</comment>
+				<params>
+					<param name="actualArity" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="getResultType" returncomment="TypeDefinition for the argument" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>Gets the return type for the function.</description>
+					<attribute name="@return">
+						<description>TypeDefinition for the argument</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getArgumentType" returncomment="TypeDefinition for the argument" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>Returns the type of the argument at position index,
+ starting at 0.</description>
+					<attribute name="@return">
+						<description>TypeDefinition for the argument</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="getArgumentNameHint" returncomment="TypeDefinition for the argument" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Name hint for the index&apos;th argument,  
+ starting at 0.</description>
+					<attribute name="@return">
+						<description>TypeDefinition for the argument</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="evaluate" returncomment="Result of evaluation." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<description>Evaluate arguments.</description>
+					<attribute name="@param">
+						<description>args
+            argument expressions.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>Result of evaluation.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="args" comment="argument expressions." fulltype="java.util.Collection" type="Collection" />
+					<param name="evaluationContext" fulltype="org.eclipse.wst.xml.xpath2.api.EvaluationContext" type="EvaluationContext" />
+				</params>
+			</method>
+			<method visibility="public" name="computeReturnType" returncomment="Result of evaluation." fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>Evaluate the exact result type.</description>
+					<attribute name="@param">
+						<description>args
+            argument expressions.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>Result of evaluation.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="args" comment="argument expressions." fulltype="java.util.Collection" type="Collection" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.FunctionLibrary" type="FunctionLibrary">
+		<comment>
+			<description>Interface for function libraries support.</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field final="true" static="true" const="2147483647" visibility="public" name="VARIABLE_ARITY" constexpr="2147483647" fulltype="int" type="int" />
+		</fields>
+		<methods>
+			<method visibility="public" name="functionExists" returncomment="Result of the test." fulltype="boolean" type="boolean">
+				<comment>
+					<description>Checks whether the function exists or not.</description>
+					<attribute name="@param">
+						<description>name
+            Name of function.</description>
+					</attribute>
+					<attribute name="@param">
+						<description>arity
+            arity of the function,</description>
+					</attribute>
+					<attribute name="@return">
+						<description>Result of the test.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="name" comment="Name of function." fulltype="java.lang.String" type="String" />
+					<param name="arity" comment="arity of the function," fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="resolveFunction" returncomment="The function from the library." fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function">
+				<comment>
+					<description>Function support.</description>
+					<attribute name="@param">
+						<description>name
+            local name .</description>
+					</attribute>
+					<attribute name="@param">
+						<description>arity
+            arity of the function.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>The function from the library.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="localName" fulltype="java.lang.String" type="String" />
+					<param name="arity" comment="arity of the function." fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="getNamespace" returncomment="Namespace." fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Returns the namespace of the function library.</description>
+					<attribute name="@return">
+						<description>Namespace.</description>
+					</attribute>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+		<comment>
+			<description>An item in the XPath2 data model</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+			<attribute name="@noimplement">
+				<description>This interface is not intended to be implemented by clients.</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getItemType" returncomment="A description of the item type." fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<comment>
+					<attribute name="@return">
+						<description>A description of the item type.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getNativeValue" returncomment="The &quot;Raw&quot; Java object, e.g. org.w3.Node for a node,
+         java.util.String for strings, etc." fulltype="java.lang.Object" type="Object">
+				<comment>
+					<attribute name="@return">
+						<description>The &quot;Raw&quot; Java object, e.g. org.w3.Node for a node,
+         java.util.String for strings, etc.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getStringValue" fulltype="java.lang.String" type="String" />
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.Match" type="Match">
+		<comment>
+			<description>A match found by the XPath2 pattern matcher
+ 
+ * @noimplement This interface is not intended to be implemented by clients.</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getMatchingCount" returncomment="The number of matching patterns on the input." fulltype="int" type="int">
+				<comment>
+					<attribute name="@return">
+						<description>The number of matching patterns on the input.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getBestMatch" returncomment="Pattern which was the best match." fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Pattern" type="XPath2Pattern">
+				<comment>
+					<description>Returns the XPath2 pattern which best matched the input (considering mode and priority)</description>
+					<attribute name="@return">
+						<description>Pattern which was the best match.</description>
+					</attribute>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.api" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer">
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field final="true" static="true" visibility="public" name="EMPTY" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+		</fields>
+		<methods>
+			<constructor visibility="public" name="ResultBuffer" />
+			<method visibility="public" name="getSequence" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+			<method visibility="public" name="clear" fulltype="void" type="void" />
+			<method visibility="public" name="add" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer">
+				<params>
+					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+				</params>
+			</method>
+			<method visibility="public" name="append" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer">
+				<params>
+					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+				</params>
+			</method>
+			<method visibility="public" name="concat" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer">
+				<params>
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
+			<method visibility="public" name="size" fulltype="int" type="int" />
+			<method visibility="public" name="iterator" fulltype="java.util.ListIterator" type="ListIterator" />
+			<method visibility="public" name="prepend" fulltype="void" type="void">
+				<params>
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
+			<method visibility="public" name="getCollection" fulltype="java.util.Collection" type="Collection" />
+			<method visibility="public" name="concat" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer">
+				<params>
+					<param name="others" fulltype="java.util.Collection" type="Collection" />
+				</params>
+			</method>
+			<method static="true" visibility="public" name="wrap" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<params>
+					<param name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+				</params>
+			</method>
+			<method visibility="public" name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="addAt" fulltype="void" type="void">
+				<params>
+					<param name="pos" fulltype="int" type="int" />
+					<param name="element" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+				</params>
+			</method>
+		</methods>
+		<jelclass final="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.api" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence" type="ResultBuffer.SingleResultSequence">
+			<implements>
+				<interface fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+			</implements>
+			<methods>
+				<constructor visibility="public" name="ResultBuffer.SingleResultSequence">
+					<params>
+						<param name="at" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+					</params>
+				</constructor>
+				<method visibility="public" name="size" fulltype="int" type="int" />
+				<method visibility="public" name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+					<params>
+						<param name="index" fulltype="int" type="int" />
+					</params>
+				</method>
+				<method visibility="public" name="first" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+				<method visibility="public" name="value" fulltype="java.lang.Object" type="Object">
+					<params>
+						<param name="index" fulltype="int" type="int" />
+					</params>
+				</method>
+				<method visibility="public" name="empty" fulltype="boolean" type="boolean" />
+				<method visibility="public" name="firstValue" fulltype="java.lang.Object" type="Object" />
+				<method visibility="public" name="iterator" fulltype="java.util.Iterator" type="Iterator" />
+				<method visibility="public" name="itemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+					<params>
+						<param name="index" fulltype="int" type="int" />
+					</params>
+				</method>
+				<method visibility="public" name="sequenceType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+			</methods>
+		</jelclass>
+		<jelclass final="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.api" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence" type="ResultBuffer.ArrayResultSequence">
+			<implements>
+				<interface fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+			</implements>
+			<methods>
+				<constructor visibility="public" name="ResultBuffer.ArrayResultSequence">
+					<params>
+						<param name="results" fulltype="org.eclipse.wst.xml.xpath2.api.Item[]" type="Item" />
+					</params>
+				</constructor>
+				<method visibility="public" name="size" fulltype="int" type="int" />
+				<method visibility="public" name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+					<params>
+						<param name="index" fulltype="int" type="int" />
+					</params>
+				</method>
+				<method visibility="public" name="empty" fulltype="boolean" type="boolean" />
+				<method visibility="public" name="firstValue" fulltype="java.lang.Object" type="Object" />
+				<method visibility="public" name="first" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+				<method visibility="public" name="iterator" fulltype="java.util.Iterator" type="Iterator" />
+				<method visibility="public" name="itemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+					<params>
+						<param name="index" fulltype="int" type="int" />
+					</params>
+				</method>
+				<method visibility="public" name="sequenceType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+				<method visibility="public" name="value" fulltype="java.lang.Object" type="Object">
+					<params>
+						<param name="index" fulltype="int" type="int" />
+					</params>
+				</method>
+			</methods>
+		</jelclass>
+	</jelclass>
+	<jelclass final="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.api" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence" type="ResultBuffer.SingleResultSequence">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+		</implements>
+		<methods>
+			<constructor visibility="public" name="ResultBuffer.SingleResultSequence">
+				<params>
+					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+				</params>
+			</constructor>
+			<method visibility="public" name="size" fulltype="int" type="int" />
+			<method visibility="public" name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="first" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+			<method visibility="public" name="value" fulltype="java.lang.Object" type="Object">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="empty" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="firstValue" fulltype="java.lang.Object" type="Object" />
+			<method visibility="public" name="iterator" fulltype="java.util.Iterator" type="Iterator" />
+			<method visibility="public" name="itemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="sequenceType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+		</methods>
+	</jelclass>
+	<jelclass final="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.api" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence" type="ResultBuffer.ArrayResultSequence">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+		</implements>
+		<methods>
+			<constructor visibility="public" name="ResultBuffer.ArrayResultSequence">
+				<params>
+					<param name="results" fulltype="org.eclipse.wst.xml.xpath2.api.Item[]" type="Item" />
+				</params>
+			</constructor>
+			<method visibility="public" name="size" fulltype="int" type="int" />
+			<method visibility="public" name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="empty" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="firstValue" fulltype="java.lang.Object" type="Object" />
+			<method visibility="public" name="first" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+			<method visibility="public" name="iterator" fulltype="java.util.Iterator" type="Iterator" />
+			<method visibility="public" name="itemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="sequenceType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+			<method visibility="public" name="value" fulltype="java.lang.Object" type="Object">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+		<comment>
+			<description>Immutable representation of a result</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="size" returncomment="Count of items." fulltype="int" type="int">
+				<comment>
+					<description>Return the size of the result set. Only call this if you need it, since it may require that the entire result
+ is fetched.</description>
+					<attribute name="@return">
+						<description>Count of items.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="value" returncomment="Native object representing the item." fulltype="java.lang.Object" type="Object">
+				<comment>
+					<description>Return the native representation of the item.</description>
+					<attribute name="@param">
+						<description>index</description>
+					</attribute>
+					<attribute name="@return">
+						<description>Native object representing the item.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="index" comment="" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="item" returncomment="Native object representing the item." fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<comment>
+					<description>Return the item.</description>
+					<attribute name="@param">
+						<description>index</description>
+					</attribute>
+					<attribute name="@return">
+						<description>Native object representing the item.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="index" comment="" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="firstValue" returncomment="Native object representing the first item." fulltype="java.lang.Object" type="Object">
+				<comment>
+					<description>Return the native representation of the first item.</description>
+					<attribute name="@return">
+						<description>Native object representing the first item.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="itemType" returncomment="" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<comment>
+					<description>XPath2 type definition description of the item at location &apos;0&apos;</description>
+					<attribute name="@param">
+						<description>index</description>
+					</attribute>
+					<attribute name="@return" />
+				</comment>
+				<params>
+					<param name="index" comment="" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="empty" returncomment="true for empty sequences" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Is the sequence empty.</description>
+					<attribute name="@return">
+						<description>true for empty sequences</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="iterator" returncomment="" fulltype="java.util.Iterator" type="Iterator">
+				<comment>
+					<description>Iterator of Item elements</description>
+					<attribute name="@return" />
+				</comment>
+			</method>
+			<method visibility="public" name="first" returncomment="" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<comment>
+					<attribute name="@return" />
+				</comment>
+			</method>
+			<method visibility="public" name="sequenceType" returncomment="Item type definition." fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<comment>
+					<description>Describe the whole sequence&apos;s type.</description>
+					<attribute name="@return">
+						<description>Item type definition.</description>
+					</attribute>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext">
+		<comment>
+			<description>interface to static context</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="isXPath1Compatible" returncomment="true if rules for backward compatibility with XPath Version 1.0
+         are in effect; otherwise false." fulltype="boolean" type="boolean">
+				<comment>
+					<description>XPath 1.0 compatibility mode.</description>
+					<attribute name="@return">
+						<description>true if rules for backward compatibility with XPath Version 1.0
+         are in effect; otherwise false.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getInScopeVariables" fulltype="org.eclipse.wst.xml.xpath2.api.StaticVariableResolver" type="StaticVariableResolver">
+				<comment>
+					<description>[Definition: In-scope variables. This is a set of (expanded QName,
+ type) pairs. It defines the set of variables that are available for
+ reference within an expression. The expanded QName is the name of the
+ variable, and the type is the static type of the variable.] An
+ expression that binds a variable (such as a for, some, or every
+ expression) extends the in-scope variables of its subexpressions with
+ the new bound variable and its type.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getInitialContextType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>[Definition: Context item static type. This component defines the
+ static type of the context item within the scope of a given
+ expression.]</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getFunctionLibraries" fulltype="java.util.Map" type="Map">
+				<comment>
+					<description>[Definition: Function signatures. This component defines the set of
+ functions that are available to be called from within an expression.
+ Each function is uniquely identified by its expanded QName and its
+ arity (number of parameters).] In addition to the name and arity, each
+ function signature specifies the static types of the function
+ parameters and result. The function signatures include the signatures
+ of constructor functions, which are discussed in 3.10.4 Constructor
+ Functions.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getCollationProvider" fulltype="org.eclipse.wst.xml.xpath2.api.CollationProvider" type="CollationProvider">
+				<comment>
+					<description>[Definition: Statically known collations. This is an
+ implementation-defined set of (URI, collation) pairs. It defines the
+ names of the collations that are available for use in processing
+ expressions.]</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getBaseUri" fulltype="java.net.URI" type="URI">
+				<comment>
+					<description>[Definition: Base URI. This is an absolute URI, used when necessary in
+ the resolution of relative URIs (for example, by the fn:resolve-uri
+ function.)] The URI value is whitespace normalized according to the
+ rules for the xs:anyURI type in [XML Schema].</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getDocumentType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<comment>
+					<description>[Definition: Statically known documents. This is a mapping from strings
+ onto types. The string represents the absolute URI of a resource that
+ is potentially available using the fn:doc function. The type is the
+ static type of a call to fn:doc with the given URI as its literal
+ argument. ] If the argument to fn:doc is a string literal that is not
+ present in statically known documents, then the static type of fn:doc
+ is document-node()?. Note: The purpose of the statically known
+ documents is to provide static type information, not to determine which
+ documents are available. A URI need not be found in the statically
+ known documents to be accessed using fn:doc.</description>
+				</comment>
+				<params>
+					<param name="documentUri" fulltype="java.net.URI" type="URI" />
+				</params>
+			</method>
+			<method visibility="public" name="getNamespaceContext" returncomment="The statically known namespace context" fulltype="javax.xml.namespace.NamespaceContext" type="NamespaceContext">
+				<comment>
+					<description>[Definition: Statically known namespaces. This is a set of (prefix,
+ URI) pairs that define all the namespaces that are known during static
+ processing of a given expression.] The URI value is whitespace
+ normalized according to the rules for the xs:anyURI type in [XML
+ Schema]. Note the difference between in-scope namespaces, which is a
+ dynamic property of an element node, and statically known namespaces,
+ which is a static property of an expression.</description>
+					<attribute name="@return">
+						<description>The statically known namespace context</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getDefaultNamespace" returncomment="" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>[Definition: Default element/type namespace. This is a namespace URI or
+ &quot;none&quot;. The namespace URI, if present, is used for any unprefixed QName
+ appearing in a position where an element or type name is expected.] The
+ URI value is whitespace normalized according to the rules for the
+ xs:anyURI type in [XML Schema].</description>
+					<attribute name="@return" />
+				</comment>
+			</method>
+			<method visibility="public" name="getDefaultFunctionNamespace" returncomment="The default function namespace" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Definition: Default function namespace. This is a namespace URI or
+ &quot;none&quot;. The namespace URI, if present, is used for any unprefixed QName
+ appearing in a position where a function name is expected.] The URI
+ value is whitespace normalized according to the rules for the xs:anyURI
+ type in [XML Schema].</description>
+					<attribute name="@return">
+						<description>The default function namespace</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getTypeModel" returncomment="A type model which covers the" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel">
+				<comment>
+					<description>[Definition: In-scope schema definitions. This is a generic term for
+ all the element declarations, attribute declarations, and schema type
+ definitions that are in scope during processing of an expression.]</description>
+					<attribute name="@return">
+						<description>A type model which covers the</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="resolveFunction" returncomment="boolean" fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function">
+				<comment>
+					<description>is the function declared/available in the source context?</description>
+					<attribute name="@param">
+						<description>name
+            is the qname name</description>
+					</attribute>
+					<attribute name="@param">
+						<description>arity
+            integer of qname</description>
+					</attribute>
+					<attribute name="@return">
+						<description>boolean</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="name" comment="is the qname name" fulltype="javax.xml.namespace.QName" type="QName" />
+					<param name="arity" comment="integer of qname" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="getCollectionType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>[Definition: Statically known collections. This is a mapping from
+ strings onto types. The string represents the absolute URI of a
+ resource that is potentially available using the fn:collection
+ function. The type is the type of the sequence of nodes that would
+ result from calling the fn:collection function with this URI as its
+ argument.] If the argument to fn:collection is a string literal that is
+ not present in statically known collections, then the static type of
+ fn:collection is node()*. Note: The purpose of the statically known
+ collections is to provide static type information, not to determine
+ which collections are available. A URI need not be found in the
+ statically known collections to be accessed using fn:collection.</description>
+				</comment>
+				<params>
+					<param name="collectionName" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getDefaultCollectionType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>[Definition: Statically known default collection type. This is the type
+ of the sequence of nodes that would result from calling the
+ fn:collection function with no arguments.] Unless initialized to some
+ other value by an implementation, the value of statically known default
+ collection type is node()*.</description>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.StaticVariableResolver" type="StaticVariableResolver">
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="isVariablePresent" returncomment="Availability of the variable" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Is the variable present in the current context.</description>
+					<attribute name="@param">
+						<description>name Variable name</description>
+					</attribute>
+					<attribute name="@return">
+						<description>Availability of the variable</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="name" comment="Variable name" fulltype="javax.xml.namespace.QName" type="QName" />
+				</params>
+			</method>
+			<method visibility="public" name="getVariableType" returncomment="" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<comment>
+					<attribute name="@param">
+						<description>name</description>
+					</attribute>
+					<attribute name="@return" />
+				</comment>
+				<params>
+					<param name="name" comment="" fulltype="javax.xml.namespace.QName" type="QName" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Engine" type="XPath2Engine">
+		<comment>
+			<description>Main API for the XPath2 processor.</description>
+			<attribute name="@noimplement">
+				<description>This interface is not intended to be implemented by clients.</description>
+			</attribute>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="parseExpression" returncomment="A compiled expression." fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Expression" type="XPath2Expression">
+				<comment>
+					<description>Parse a full XPath2 expression and type check it against the static context
+ (if it provides a type model to check against)</description>
+					<attribute name="@param">
+						<description>expression String representation of XPath2 expression</description>
+					</attribute>
+					<attribute name="@param">
+						<description>context Static context for the expression.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>A compiled expression.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="expression" comment="String representation of XPath2 expression" fulltype="java.lang.String" type="String" />
+					<param name="context" comment="Static context for the expression." fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Expression" type="XPath2Expression">
+		<comment>
+			<description>This interface represents a parsed and statically bound XPath2 expression.</description>
+			<attribute name="@noimplement">
+				<description>This interface is not intended to be implemented by clients.</description>
+			</attribute>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getFreeVariables" returncomment="A Collection containing javax.xml.namespacing.QName of free variables" fulltype="java.util.Collection" type="Collection">
+				<comment>
+					<description>Return a collections of QNames of the names of free variables referenced in the XPath expression.
+ These variables may be requested during evaluation.</description>
+					<attribute name="@return">
+						<description>A Collection containing javax.xml.namespacing.QName of free variables</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getResolvedFunctions" returncomment="A Collection containing javax.xml.namespacing.QName of functions in use." fulltype="java.util.Collection" type="Collection">
+				<comment>
+					<description>Return a collections of the functions used in the XPath2 expression.</description>
+					<attribute name="@return">
+						<description>A Collection containing javax.xml.namespacing.QName of functions in use.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getAxes" returncomment="A Collection containing Strings with the axis names in use." fulltype="java.util.Collection" type="Collection">
+				<comment>
+					<description>Return a collections of the axis used in the XPath2 expression.</description>
+					<attribute name="@return">
+						<description>A Collection containing Strings with the axis names in use.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="isRootPathUsed" returncomment="true if the expression uses / or //, false otherwise." fulltype="boolean" type="boolean">
+				<comment>
+					<description>Whether or not the root path is in use in the XPath2 expression.</description>
+					<attribute name="@return">
+						<description>true if the expression uses / or //, false otherwise.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="evaluate" returncomment="A ResultSequence" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<description>Evaluate the XPath2 expression, using the supplied DynamicContext.</description>
+					<attribute name="@param">
+						<description>dynamicContext Dynamic context for the expression.</description>
+					</attribute>
+					<attribute name="@param">
+						<description>contextItems Context item (typically nodes, often one) to evaluate under.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>A ResultSequence</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="dynamicContext" comment="Dynamic context for the expression." fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
+					<param name="contextItems" comment="Context item (typically nodes, often one) to evaluate under." fulltype="java.lang.Object[]" type="Object" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Pattern" type="XPath2Pattern">
+		<comment>
+			<description>This is a compiled pattern (which is a simpler version of an expression, used to match in XSLT files, etc.)</description>
+			<attribute name="@noimplement">
+				<description>This interface is not intended to be implemented by clients.</description>
+			</attribute>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getUserData" returncomment="The object passed in my the caller when the patten was created." fulltype="java.lang.Object" type="Object">
+				<comment>
+					<attribute name="@return">
+						<description>The object passed in my the caller when the patten was created.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="matches" fulltype="boolean" type="boolean">
+				<params>
+					<param name="dc" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.w3c.dom.Node" type="Node" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.XPath2PatternSet" type="XPath2PatternSet">
+		<comment>
+			<attribute name="@noimplement">
+				<description>This interface is not intended to be implemented by clients.</description>
+			</attribute>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="compilePattern" fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Pattern" type="XPath2Pattern">
+				<params>
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+					<param name="pattern" fulltype="java.lang.String" type="String" />
+					<param name="mode" fulltype="java.lang.String" type="String" />
+					<param name="priority" fulltype="int" type="int" />
+					<param name="userData" fulltype="java.lang.Object" type="Object" />
+				</params>
+			</method>
+			<method visibility="public" name="removePattern" fulltype="void" type="void">
+				<params>
+					<param name="pattern" fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Pattern" type="XPath2Pattern" />
+				</params>
+			</method>
+			<method visibility="public" name="clear" fulltype="void" type="void" />
+			<method visibility="public" name="match" fulltype="org.eclipse.wst.xml.xpath2.api.Match" type="Match">
+				<params>
+					<param name="dc" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.w3c.dom.Node" type="Node" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api.typesystem" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition" type="ComplexTypeDefinition">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+		</implements>
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field final="true" static="true" const="0" visibility="public" name="CONTENT_EMPTY" constexpr="0" fulltype="short" type="short">
+				<comment>
+					<description>Represents an empty content type. A content type with the distinguished 
+ value empty validates elements with no character or element 
+ information item children.</description>
+				</comment>
+			</field>
+			<field final="true" static="true" const="1" visibility="public" name="CONTENT_SIMPLE" constexpr="1" fulltype="short" type="short">
+				<comment>
+					<description>Represents a simple content type. A content type which is simple 
+ validates elements with character-only children.</description>
+				</comment>
+			</field>
+			<field final="true" static="true" const="2" visibility="public" name="CONTENT_ELEMENT" constexpr="2" fulltype="short" type="short">
+				<comment>
+					<description>Represents an element-only content type. An element-only content type 
+ validates elements with children that conform to the supplied content 
+ model.</description>
+				</comment>
+			</field>
+			<field final="true" static="true" const="3" visibility="public" name="CONTENT_MIXED" constexpr="3" fulltype="short" type="short">
+				<comment>
+					<description>Represents a mixed content type.</description>
+				</comment>
+			</field>
+		</fields>
+		<methods>
+			<method visibility="public" name="getDerivationMethod" fulltype="short" type="short">
+				<comment>
+					<description>[derivation method]: either &lt;code&gt;DERIVATION_EXTENSION&lt;/code&gt;, 
+ &lt;code&gt;DERIVATION_RESTRICTION&lt;/code&gt;, or &lt;code&gt;DERIVATION_NONE&lt;/code&gt; 
+ (see &lt;code&gt;XSConstants&lt;/code&gt;).</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getAbstract" fulltype="boolean" type="boolean">
+				<comment>
+					<description>[abstract]: a boolean. Complex types for which &lt;code&gt;abstract&lt;/code&gt; is 
+ true must not be used as the type definition for the validation of 
+ element information items.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getContentType" fulltype="short" type="short">
+				<comment>
+					<description>[content type]: one of empty (&lt;code&gt;CONTENTTYPE_EMPTY&lt;/code&gt;), a simple 
+ type definition (&lt;code&gt;CONTENTTYPE_SIMPLE&lt;/code&gt;), mixed (
+ &lt;code&gt;CONTENTTYPE_MIXED&lt;/code&gt;), or element-only (
+ &lt;code&gt;CONTENTTYPE_ELEMENT&lt;/code&gt;).</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getSimpleType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition" type="SimpleTypeDefinition">
+				<comment>
+					<description>A simple type definition corresponding to a simple content model, 
+ otherwise &lt;code&gt;null&lt;/code&gt;.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="isProhibitedSubstitution" returncomment="True if &lt;code&gt;restriction&lt;/code&gt; is a prohibited substitution, 
+   otherwise false." fulltype="boolean" type="boolean">
+				<comment>
+					<description>[prohibited substitutions]: a subset of {extension, restriction}</description>
+					<attribute name="@param">
+						<description>restriction  Extension or restriction constants (see 
+   &lt;code&gt;XSConstants&lt;/code&gt;).</description>
+					</attribute>
+					<attribute name="@return">
+						<description>True if &lt;code&gt;restriction&lt;/code&gt; is a prohibited substitution, 
+   otherwise false.</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="restriction" comment="Extension or restriction constants (see 
+   &lt;code&gt;XSConstants&lt;/code&gt;)." fulltype="short" type="short" />
+				</params>
+			</method>
+			<method visibility="public" name="getProhibitedSubstitutions" fulltype="short" type="short">
+				<comment>
+					<description>[prohibited substitutions]: A subset of {extension, restriction} or 
+ &lt;code&gt;DERIVATION_NONE&lt;/code&gt; represented as a bit flag (see 
+ &lt;code&gt;XSConstants&lt;/code&gt;).</description>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api.typesystem" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field final="true" static="true" const="0" visibility="public" name="OCCURRENCE_OPTIONAL" constexpr="0" fulltype="short" type="short" />
+			<field final="true" static="true" const="1" visibility="public" name="OCCURRENCE_ONE" constexpr="1" fulltype="short" type="short" />
+			<field final="true" static="true" const="2" visibility="public" name="OCCURRENCE_NONE_OR_MANY" constexpr="2" fulltype="short" type="short" />
+			<field final="true" static="true" const="3" visibility="public" name="OCCURRENCE_ONE_OR_MANY" constexpr="3" fulltype="short" type="short" />
+			<field final="true" static="true" const="1" visibility="public" name="ALWAYS_ONE_MASK" constexpr="1" fulltype="short" type="short" />
+			<field final="true" static="true" const="2" visibility="public" name="MAYBE_MANY_MASK" constexpr="2" fulltype="short" type="short" />
+		</fields>
+		<methods>
+			<method visibility="public" name="getOccurrence" fulltype="short" type="short" />
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api.typesystem" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType" type="NodeItemType">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+		</implements>
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="isWildcard" returncomment="Wildcard test?" fulltype="boolean" type="boolean">
+				<comment>
+					<description>For attribute and element types, return whether the name
+ part of the type test is a wildcard.</description>
+					<attribute name="@return">
+						<description>Wildcard test?</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getName" returncomment="name of the item type, if applicable, otherwise null" fulltype="javax.xml.namespace.QName" type="QName">
+				<comment>
+					<attribute name="@return">
+						<description>name of the item type, if applicable, otherwise null</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getNodeType" returncomment="The DOM node type" fulltype="short" type="short">
+				<comment>
+					<description>Node type as per list in org.w3c.dom.Node</description>
+					<attribute name="@return">
+						<description>The DOM node type</description>
+					</attribute>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api.typesystem" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.PrimitiveType" type="PrimitiveType">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+		</implements>
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="validate" returncomment="the actual value (QName, Boolean) of the string value" fulltype="boolean" type="boolean">
+				<comment>
+					<description>validate a given string against this simple type.</description>
+					<attribute name="@param">
+						<description>content       the string value that needs to be validated</description>
+					</attribute>
+					<attribute name="@param">
+						<description>context       the validation context</description>
+					</attribute>
+					<attribute name="@param">
+						<description>validatedInfo used to store validation result</description>
+					</attribute>
+					<attribute name="@return">
+						<description>the actual value (QName, Boolean) of the string value</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="content" comment="the string value that needs to be validated" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="validateNative" returncomment="the actual value (QName, Boolean) of the string value" fulltype="boolean" type="boolean">
+				<comment>
+					<description>validate a given string against this simple type.</description>
+					<attribute name="@param">
+						<description>content       the string value that needs to be validated</description>
+					</attribute>
+					<attribute name="@param">
+						<description>context       the validation context</description>
+					</attribute>
+					<attribute name="@param">
+						<description>validatedInfo used to store validation result</description>
+					</attribute>
+					<attribute name="@return">
+						<description>the actual value (QName, Boolean) of the string value</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="content" comment="the string value that needs to be validated" fulltype="java.lang.Object" type="Object" />
+				</params>
+			</method>
+			<method visibility="public" name="construct" returncomment="the actual value (QName, Boolean) of the string value" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<comment>
+					<description>validate a given string against this simple type.</description>
+					<attribute name="@param">
+						<description>content       the string value that needs to be validated</description>
+					</attribute>
+					<attribute name="@param">
+						<description>context       the validation context</description>
+					</attribute>
+					<attribute name="@param">
+						<description>validatedInfo used to store validation result</description>
+					</attribute>
+					<attribute name="@return">
+						<description>the actual value (QName, Boolean) of the string value</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="content" comment="the string value that needs to be validated" fulltype="java.lang.Object" type="Object" />
+				</params>
+			</method>
+			<method visibility="public" name="getInterfaceClass" returncomment="the actual value (QName, Boolean) of the string value" fulltype="java.lang.Class" type="Class">
+				<comment>
+					<attribute name="@return">
+						<description>the actual value (QName, Boolean) of the string value</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getNativeType" returncomment="The expected native type (class or interface) to expect when calling getValue." fulltype="java.lang.Class" type="Class">
+				<comment>
+					<attribute name="@return">
+						<description>The expected native type (class or interface) to expect when calling getValue.</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="isEqual" returncomment="true if the two value are equal" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Check whether two actual values are equal.</description>
+					<attribute name="@param">
+						<description>value1  the first value</description>
+					</attribute>
+					<attribute name="@param">
+						<description>value2  the second value</description>
+					</attribute>
+					<attribute name="@return">
+						<description>true if the two value are equal</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="value1" comment="the first value" fulltype="java.lang.Object" type="Object" />
+					<param name="value2" comment="the second value" fulltype="java.lang.Object" type="Object" />
+				</params>
+			</method>
+			<method visibility="public" name="isIDType" returncomment="whether this simple type is or is derived from ID." fulltype="boolean" type="boolean">
+				<comment>
+					<description>Check whether this type is or is derived from ID.
+ REVISIT: this method makes ID special, which is not a good design.
+          but since ID is not a primitive, there doesn&apos;t seem to be a
+          clean way of doing it except to define special method like this.</description>
+					<attribute name="@return">
+						<description>whether this simple type is or is derived from ID.</description>
+					</attribute>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api.typesystem" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition" type="SimpleTypeDefinition">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+		</implements>
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field final="true" static="true" const="0" visibility="public" name="VARIETY_ABSENT" constexpr="0" fulltype="short" type="short">
+				<comment>
+					<description>The variety is absent for the anySimpleType definition.</description>
+				</comment>
+			</field>
+			<field final="true" static="true" const="1" visibility="public" name="VARIETY_ATOMIC" constexpr="1" fulltype="short" type="short">
+				<comment>
+					<description>&lt;code&gt;Atomic&lt;/code&gt; type.</description>
+				</comment>
+			</field>
+			<field final="true" static="true" const="2" visibility="public" name="VARIETY_LIST" constexpr="2" fulltype="short" type="short">
+				<comment>
+					<description>&lt;code&gt;List&lt;/code&gt; type.</description>
+				</comment>
+			</field>
+			<field final="true" static="true" const="3" visibility="public" name="VARIETY_UNION" constexpr="3" fulltype="short" type="short">
+				<comment>
+					<description>&lt;code&gt;Union&lt;/code&gt; type.</description>
+				</comment>
+			</field>
+		</fields>
+		<methods>
+			<method visibility="public" name="getVariety" fulltype="short" type="short">
+				<comment>
+					<description>[variety]: one of {atomic, list, union} or absent.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getPrimitiveType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition" type="SimpleTypeDefinition">
+				<comment>
+					<description>If variety is &lt;code&gt;atomic&lt;/code&gt; the primitive type definition (a 
+ built-in primitive datatype definition or the simple ur-type 
+ definition) is available, otherwise &lt;code&gt;null&lt;/code&gt;.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getBuiltInKind" fulltype="short" type="short">
+				<comment>
+					<description>Returns the closest built-in type category this type represents or 
+ derived from. For example, if this simple type is a built-in derived 
+ type integer the &lt;code&gt;INTEGER_DV&lt;/code&gt; is returned.
+ 
+ KILL!</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getItemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>If variety is &lt;code&gt;list&lt;/code&gt; the item type definition (an atomic or 
+ union simple type definition) is available, otherwise 
+ &lt;code&gt;null&lt;/code&gt;.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getMemberTypes" fulltype="java.util.List" type="List">
+				<comment>
+					<description>If variety is &lt;code&gt;union&lt;/code&gt; the list of member type definitions (a 
+ non-empty sequence of simple type definitions) is available, 
+ otherwise an empty &lt;code&gt;XSObjectList&lt;/code&gt;.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getOrdered" fulltype="short" type="short">
+				<comment>
+					<description>Fundamental Facet: ordered.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getFinite" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Fundamental Facet: cardinality.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getBounded" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Fundamental Facet: bounded.</description>
+				</comment>
+			</method>
+			<method visibility="public" name="getNumeric" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Fundamental Facet: numeric.</description>
+				</comment>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api.typesystem" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+		<comment>
+			<attribute name="@noimplement">
+				<description>This interface is not intended to be implemented by clients.</description>
+			</attribute>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field final="true" static="true" const="0" visibility="public" name="DERIVATION_NONE" constexpr="0" fulltype="short" type="short" />
+			<field final="true" static="true" const="1" visibility="public" name="DERIVATION_EXTENSION" constexpr="1" fulltype="short" type="short" />
+			<field final="true" static="true" const="2" visibility="public" name="DERIVATION_RESTRICTION" constexpr="2" fulltype="short" type="short" />
+			<field final="true" static="true" const="4" visibility="public" name="DERIVATION_SUBSTITUTION" constexpr="4" fulltype="short" type="short" />
+			<field final="true" static="true" const="8" visibility="public" name="DERIVATION_UNION" constexpr="8" fulltype="short" type="short" />
+			<field final="true" static="true" const="16" visibility="public" name="DERIVATION_LIST" constexpr="16" fulltype="short" type="short" />
+		</fields>
+		<methods>
+			<method visibility="public" name="getNamespace" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getName" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getBaseType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="derivedFromType" fulltype="boolean" type="boolean">
+				<params>
+					<param name="ancestorType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+					<param name="derivationMethod" fulltype="short" type="short" />
+				</params>
+			</method>
+			<method visibility="public" name="derivedFrom" fulltype="boolean" type="boolean">
+				<params>
+					<param name="namespace" fulltype="java.lang.String" type="String" />
+					<param name="name" fulltype="java.lang.String" type="String" />
+					<param name="derivationMethod" fulltype="short" type="short" />
+				</params>
+			</method>
+			<method visibility="public" name="getNativeType" fulltype="java.lang.Class" type="Class" />
+			<method visibility="public" name="getSimpleTypes" fulltype="java.util.List" type="List">
+				<params>
+					<param name="attr" fulltype="org.w3c.dom.Attr" type="Attr" />
+				</params>
+			</method>
+			<method visibility="public" name="getSimpleTypes" fulltype="java.util.List" type="List">
+				<params>
+					<param name="attr" fulltype="org.w3c.dom.Element" type="Element" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.api.typesystem" interface="true" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel">
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<method visibility="public" name="getType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<params>
+					<param name="node" fulltype="org.w3c.dom.Node" type="Node" />
+				</params>
+			</method>
+			<method visibility="public" name="lookupType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<params>
+					<param name="namespace" fulltype="java.lang.String" type="String" />
+					<param name="typeName" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="lookupElementDeclaration" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<params>
+					<param name="namespace" fulltype="java.lang.String" type="String" />
+					<param name="elementName" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="lookupAttributeDeclaration" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<params>
+					<param name="namespace" fulltype="java.lang.String" type="String" />
+					<param name="attributeName" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
 	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.CollationProvider" type="CollationProvider">
 		<comment>
 			<description>Service provider interface for looking up collations from within the dynamic context.</description>
 			<attribute name="@since">
 				<description>1.1</description>
 			</attribute>
+			<attribute name="@deprecated">
+				<description>Use org.eclipse.wst.xml.xpath2.api.CollationProvider instead</description>
+			</attribute>
 		</comment>
 		<methods>
 			<method visibility="public" name="get_collation" returncomment="The collation to use, or null if no such collation exists by this provider" fulltype="java.util.Comparator" type="Comparator">
@@ -123,6 +1719,9 @@
 	<jelclass superclass="XPathException" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.XPathException" fulltype="org.eclipse.wst.xml.xpath2.processor.DOMLoaderException" type="DOMLoaderException">
 		<comment>
 			<description>Exception caused by DOM loader.</description>
+			<attribute name="@deprecated">
+				<description>Only used in deprecated APIs</description>
+			</attribute>
 		</comment>
 		<methods>
 			<constructor visibility="public" name="DOMLoaderException">
@@ -163,10 +1762,29 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="schema" comment="Schema information of document. May be null" fulltype="org.apache.xerces.xs.XSModel" type="XSModel" />
+					<param name="schema" comment="Schema information of document. May be null" fulltype="XSModel" type="XSModel" />
 					<param name="doc" comment="Document [root] node of XML source." fulltype="org.w3c.dom.Document" type="Document" />
 				</params>
 			</constructor>
+			<constructor visibility="public" name="DefaultDynamicContext">
+				<comment>
+					<description>Constructor.</description>
+					<attribute name="@param">
+						<description>schema
+            Schema information of document. May be null</description>
+					</attribute>
+					<attribute name="@param">
+						<description>doc
+            Document [root] node of XML source.</description>
+					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="schema" comment="Schema information of document. May be null" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
+				</params>
+			</constructor>
 			<method visibility="public" name="tz" returncomment="an xs:integer _tz" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration" type="XSDuration">
 				<comment>
 					<description>Reads the day from a TimeDuration type</description>
@@ -233,12 +1851,15 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="get_variable" returncomment="an AnyType result from get_var(name) or return NULL" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="public" name="get_variable" returncomment="an AnyType result from get_var(name) or return NULL" fulltype="java.lang.Object" type="Object">
 				<comment>
 					<description>Retrieve the variable name</description>
 					<attribute name="@return">
 						<description>an AnyType result from get_var(name) or return NULL</description>
 					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
 				</comment>
 				<params>
 					<param name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -311,6 +1932,17 @@
 					<param name="val" comment="Variable value." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
 			</method>
+			<method visibility="public" name="set_variable" fulltype="void" type="void">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="var" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+					<param name="val" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
 			<method visibility="public" name="set_default_collation" fulltype="void" type="void">
 				<comment>
 					<attribute name="@since">
@@ -362,6 +1994,16 @@
 					<param name="node" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="getTypeModel" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="node" fulltype="org.w3c.dom.Node" type="Node" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator" type="DefaultEvaluator">
@@ -374,22 +2016,29 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="DefaultEvaluator">
+				<params>
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="doc" fulltype="org.w3c.dom.Document" type="Document" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="DefaultEvaluator">
 				<comment>
-					<description>set parameters</description>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@param">
-						<description>doc
-            is the document.</description>
+					<attribute name="@since">
+						<description>2.0</description>
 					</attribute>
 				</comment>
 				<params>
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
-					<param name="doc" comment="is the document." fulltype="org.w3c.dom.Document" type="Document" />
+					<param name="staticContext" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
+					<param name="contextItems" fulltype="java.lang.Object[]" type="Object" />
 				</params>
 			</constructor>
+			<method visibility="package-private" name="focus" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.Focus" type="Focus" />
+			<method visibility="package-private" name="set_focus" fulltype="void" type="void">
+				<params>
+					<param name="f" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.Focus" type="Focus" />
+				</params>
+			</method>
 			<method visibility="public" name="evaluate" returncomment="result sequence." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>evaluate the xpath node</description>
@@ -408,9 +2057,16 @@
 				<params>
 					<param name="node" comment="is the xpath node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode" type="XPathNode" />
 				</params>
-				<exceptions>
-					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
-				</exceptions>
+			</method>
+			<method visibility="public" name="evaluate2" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="node" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode" type="XPathNode" />
+				</params>
 			</method>
 			<method visibility="public" name="visit" returncomment="result sequence." fulltype="java.lang.Object" type="Object">
 				<comment>
@@ -1163,16 +2819,6 @@
 				</params>
 			</method>
 		</methods>
-		<jelclass superclass="Error" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="java.lang.Error" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.DummyError" type="DefaultEvaluator.DummyError">
-			<methods>
-				<constructor visibility="public" name="DefaultEvaluator.DummyError">
-					<params>
-						<param name="type" fulltype="int" type="int" />
-					</params>
-				</constructor>
-				<method visibility="public" name="type" fulltype="int" type="int" />
-			</methods>
-		</jelclass>
 		<jelclass superclass="Object" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.Pair" type="DefaultEvaluator.Pair">
 			<fields>
 				<field visibility="public" name="_one" fulltype="java.lang.Object" type="Object" />
@@ -1187,16 +2833,22 @@
 				</constructor>
 			</methods>
 		</jelclass>
-	</jelclass>
-	<jelclass superclass="Error" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="java.lang.Error" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.DummyError" type="DefaultEvaluator.DummyError">
-		<methods>
-			<constructor visibility="public" name="DefaultEvaluator.DummyError">
-				<params>
-					<param name="type" fulltype="int" type="int" />
-				</params>
-			</constructor>
-			<method visibility="public" name="type" fulltype="int" type="int" />
-		</methods>
+		<jelclass superclass="Object" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope" type="DefaultEvaluator.VariableScope">
+			<fields>
+				<field final="true" visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+				<field final="true" visibility="public" name="value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				<field final="true" visibility="public" name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope" type="DefaultEvaluator.VariableScope" />
+			</fields>
+			<methods>
+				<constructor visibility="public" name="DefaultEvaluator.VariableScope">
+					<params>
+						<param name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+						<param name="value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+						<param name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope" type="DefaultEvaluator.VariableScope" />
+					</params>
+				</constructor>
+			</methods>
+		</jelclass>
 	</jelclass>
 	<jelclass superclass="Object" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.Pair" type="DefaultEvaluator.Pair">
 		<fields>
@@ -1212,12 +2864,31 @@
 			</constructor>
 		</methods>
 	</jelclass>
+	<jelclass superclass="Object" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope" type="DefaultEvaluator.VariableScope">
+		<fields>
+			<field final="true" visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+			<field final="true" visibility="public" name="value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+			<field final="true" visibility="public" name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope" type="DefaultEvaluator.VariableScope" />
+		</fields>
+		<methods>
+			<constructor visibility="public" name="DefaultEvaluator.VariableScope">
+				<params>
+					<param name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+					<param name="value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope" type="DefaultEvaluator.VariableScope" />
+				</params>
+			</constructor>
+		</methods>
+	</jelclass>
 	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext">
 		<implements>
 			<interface fulltype="org.eclipse.wst.xml.xpath2.processor.StaticContext" type="StaticContext" />
 		</implements>
 		<comment>
 			<description>Interface for dynamic context.</description>
+			<attribute name="@deprecated">
+				<description>Use</description>
+			</attribute>
 		</comment>
 		<fields>
 			<field final="true" static="true" const="http://www.w3.org/2005/xpath-functions/collation/codepoint" visibility="public" name="CODEPOINT_COLLATION" constexpr="&quot;http://www.w3.org/2005/xpath-functions/collation/codepoint&quot;" fulltype="java.lang.String" type="String">
@@ -1254,7 +2925,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="get_variable" returncomment="variable." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="public" name="get_variable" returncomment="variable." fulltype="java.lang.Object" type="Object">
 				<comment>
 					<description>Get variable.</description>
 					<attribute name="@param">
@@ -1264,6 +2935,9 @@
 					<attribute name="@return">
 						<description>variable.</description>
 					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
 				</comment>
 				<params>
 					<param name="name" comment="is the name of the variable." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -1286,6 +2960,18 @@
 					<param name="val" comment="is the value to be set for the variable." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
 			</method>
+			<method visibility="public" name="set_variable" fulltype="void" type="void">
+				<comment>
+					<description>Sets a XPath2 sequence into a variable.</description>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="var" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+					<param name="val" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
 			<method visibility="public" name="evaluate_function" returncomment="result of the function evaluation." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Evaluate the function of the arguments.</description>
@@ -1675,6 +3361,25 @@
 					<param name="err" comment="is the error" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
+			<method static="true" visibility="public" name="runtime_error" returncomment="the DynamicError." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError">
+				<comment>
+					<description>Returns the dynamic error for an unsupported normalization form</description>
+					<attribute name="@param">
+						<description>err
+            is the error</description>
+					</attribute>
+					<attribute name="@return">
+						<description>the DynamicError.</description>
+					</attribute>
+					<attribute name="@since">
+						<description>1.1</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="msg" fulltype="java.lang.String" type="String" />
+					<param name="err" comment="is the error" fulltype="java.lang.Throwable" type="Throwable" />
+				</params>
+			</method>
 			<method static="true" visibility="public" name="lexical_error" returncomment="the make_error" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError">
 				<comment>
 					<description>Returns the error message when reads an Invalid lexical value</description>
@@ -1941,6 +3646,30 @@
 			</method>
 		</methods>
 	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.Engine" type="Engine">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Engine" type="XPath2Engine" />
+		</implements>
+		<comment>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<methods>
+			<constructor visibility="public" name="Engine" />
+			<method visibility="public" name="parseExpression" fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Expression" type="XPath2Expression">
+				<params>
+					<param name="expression" fulltype="java.lang.String" type="String" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+				</params>
+			</method>
+			<method visibility="package-private" name="effectiveBooleanValue" fulltype="boolean" type="boolean">
+				<params>
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
 	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.Evaluator" type="Evaluator">
 		<comment>
 			<description>interface to Evaluator</description>
@@ -2000,11 +3729,67 @@
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.XPathParserException" type="XPathParserException" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="parse" returncomment="the xpath value." fulltype="org.eclipse.wst.xml.xpath2.processor.ast.XPath" type="XPath">
+				<comment>
+					<description>Tries to parse the xpath expression</description>
+					<attribute name="@param">
+						<description>xpath
+            is the xpath string.</description>
+					</attribute>
+					<attribute name="@param">
+						<description>isRootlessAccess
+            if &apos;true&apos; then PsychoPath engine can&apos;t parse xpath expressions starting with / or //.</description>
+					</attribute>
+					<attribute name="@throws">
+						<description>XPathParserException.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>the xpath value.</description>
+					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="xpath" comment="is the xpath string." fulltype="java.lang.String" type="String" />
+					<param name="isRootlessAccess" comment="if &apos;true&apos; then PsychoPath engine can&apos;t parse xpath expressions starting with / or //." fulltype="boolean" type="boolean" />
+				</params>
+				<exceptions>
+					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.XPathParserException" type="XPathParserException" />
+				</exceptions>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.PsychoPathTypeHelper" type="PsychoPathTypeHelper">
+		<comment>
+			<description>An PsychoPath Engine helper class providing useful module implementations for commonly 
+ performed &quot;XML schema&quot; evaluation tasks.</description>
+			<attribute name="@since">
+				<description>2.0</description>
+			</attribute>
+		</comment>
+		<fields>
+			<field static="true" visibility="public" name="DAYTIMEDURATION_DT" fulltype="short" type="short" />
+			<field static="true" visibility="public" name="YEARMONTHDURATION_DT" fulltype="short" type="short" />
+		</fields>
+		<methods>
+			<constructor visibility="public" name="PsychoPathTypeHelper" />
+			<method static="true" visibility="public" name="getXSDTypeShortCode" fulltype="short" type="short">
+				<params>
+					<param name="typeDef" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+		</implements>
 		<comment>
 			<description>Interface to the methods of range of result sequence</description>
+			<attribute name="@deprecated">
+				<description>Use org.eclipse.wst.xml.xpath2.api.ResultSequence instead</description>
+			</attribute>
 		</comment>
 		<methods>
 			<constructor visibility="public" name="ResultSequence" />
@@ -2099,6 +3884,36 @@
 					<description>release the result sequence</description>
 				</comment>
 			</method>
+			<method visibility="public" name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="itemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="value" fulltype="java.lang.Object" type="Object">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory" type="ResultSequenceFactory">
@@ -2186,6 +4001,9 @@
 	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticContext" type="StaticContext">
 		<comment>
 			<description>interface to static context</description>
+			<attribute name="@deprecated">
+				<description>See &lt;tt&gt;org.eclipse.wst.xml.xpath2.api.StaticContext&lt;/tt&gt; instead</description>
+			</attribute>
 		</comment>
 		<methods>
 			<method visibility="public" name="xpath1_compatible" returncomment="boolean" fulltype="boolean" type="boolean">
@@ -2241,7 +4059,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="attribute_type_definition" returncomment="attributes&apos;s type definition" fulltype="org.apache.xerces.xs.XSTypeDefinition" type="XSTypeDefinition">
+			<method visibility="public" name="attribute_type_definition" returncomment="attributes&apos;s type definition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
 				<comment>
 					<attribute name="@param">
 						<description>attr
@@ -2250,12 +4068,15 @@
 					<attribute name="@return">
 						<description>attributes&apos;s type definition</description>
 					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
 				</comment>
 				<params>
 					<param name="attr" comment="is the qname variable" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
 				</params>
 			</method>
-			<method visibility="public" name="element_type_definition" returncomment="element&apos;s type definition" fulltype="org.apache.xerces.xs.XSTypeDefinition" type="XSTypeDefinition">
+			<method visibility="public" name="element_type_definition" returncomment="element&apos;s type definition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
 				<comment>
 					<attribute name="@param">
 						<description>elem
@@ -2435,10 +4256,13 @@
 					<attribute name="@return">
 						<description>boolean</description>
 					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
 				</comment>
 				<params>
 					<param name="at" comment="the node type" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="et" comment="is the XSTypeDefinition of the node" fulltype="org.apache.xerces.xs.XSTypeDefinition" type="XSTypeDefinition" />
+					<param name="et" comment="is the XSTypeDefinition of the node" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 				</params>
 			</method>
 			<method visibility="public" name="add_namespace" fulltype="void" type="void">
@@ -2546,20 +4370,37 @@
 			<method visibility="public" name="get_collections" fulltype="java.util.Map" type="Map">
 				<comment>
 					<attribute name="@since">
-						<description>1.1</description>
+						<description>1.1
+ 
+ Gets the collections map, which maps a String into a List of Document, in
+ Java5 it would be &lt;code&gt;Map&lt;String, List&lt;Document&gt;&gt;&lt;/code&gt;</description>
 					</attribute>
 				</comment>
 			</method>
 			<method visibility="public" name="set_collections" fulltype="void" type="void">
 				<comment>
 					<attribute name="@since">
-						<description>1.1</description>
+						<description>1.1
+ 
+ Sets the collections map, which maps a String into a List of Document, in
+ Java5 it would be &lt;code&gt;Map&lt;String, List&lt;Document&gt;&gt;&lt;/code&gt;</description>
 					</attribute>
 				</comment>
 				<params>
 					<param name="collections" fulltype="java.util.Map" type="Map" />
 				</params>
 			</method>
+			<method visibility="public" name="getTypeModel" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel">
+				<comment>
+					<description>Gets the type provider in use for the specified DOM node.</description>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="element" fulltype="org.w3c.dom.Node" type="Node" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass superclass="XPathException" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.XPathException" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticError" type="StaticError">
@@ -2609,11 +4450,45 @@
 						<description>sc
             is the static context.</description>
 					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
 				</comment>
 				<params>
 					<param name="sc" comment="is the static context." fulltype="org.eclipse.wst.xml.xpath2.processor.StaticContext" type="StaticContext" />
 				</params>
 			</constructor>
+			<constructor visibility="public" name="StaticNameResolver">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+				</params>
+			</constructor>
+			<method visibility="public" name="getAxes" fulltype="java.util.Set" type="Set">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getFreeVariables" fulltype="java.util.Set" type="Set">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getResolvedFunctions" fulltype="java.util.Set" type="Set">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
 			<method visibility="public" name="check" fulltype="void" type="void">
 				<comment>
 					<description>Check the XPath node.</description>
@@ -3417,19 +5292,58 @@
 					<param name="e" comment="is the expression." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr" type="FilterExpr" />
 				</params>
 			</method>
+			<method visibility="public" name="isRootUsed" fulltype="boolean" type="boolean">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
 		</methods>
 		<jelclass superclass="Error" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="java.lang.Error" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.DummyError" type="StaticNameResolver.DummyError">
 			<methods>
 				<constructor visibility="package-private" name="StaticNameResolver.DummyError" />
 			</methods>
 		</jelclass>
+		<jelclass superclass="Object" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope" type="StaticNameResolver.VariableScope">
+			<fields>
+				<field final="true" visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+				<field final="true" visibility="public" name="typeDef" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+				<field final="true" visibility="public" name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope" type="StaticNameResolver.VariableScope" />
+			</fields>
+			<methods>
+				<constructor visibility="public" name="StaticNameResolver.VariableScope">
+					<params>
+						<param name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+						<param name="typeDef" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+						<param name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope" type="StaticNameResolver.VariableScope" />
+					</params>
+				</constructor>
+			</methods>
+		</jelclass>
 	</jelclass>
 	<jelclass superclass="Error" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="java.lang.Error" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.DummyError" type="StaticNameResolver.DummyError">
 		<methods>
 			<constructor visibility="package-private" name="StaticNameResolver.DummyError" />
 		</methods>
 	</jelclass>
-	<jelclass superclass="Exception" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="java.lang.Exception" fulltype="org.eclipse.wst.xml.xpath2.processor.XPathException" type="XPathException">
+	<jelclass superclass="Object" visibility="package-private" package="org.eclipse.wst.xml.xpath2.processor" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope" type="StaticNameResolver.VariableScope">
+		<fields>
+			<field final="true" visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+			<field final="true" visibility="public" name="typeDef" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+			<field final="true" visibility="public" name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope" type="StaticNameResolver.VariableScope" />
+		</fields>
+		<methods>
+			<constructor visibility="public" name="StaticNameResolver.VariableScope">
+				<params>
+					<param name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+					<param name="typeDef" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+					<param name="nextScope" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope" type="StaticNameResolver.VariableScope" />
+				</params>
+			</constructor>
+		</methods>
+	</jelclass>
+	<jelclass superclass="RuntimeException" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="java.lang.RuntimeException" fulltype="org.eclipse.wst.xml.xpath2.processor.XPathException" type="XPathException">
 		<comment>
 			<description>This exception is thrown when there is a problem with an XPath exception.</description>
 		</comment>
@@ -3454,6 +5368,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getMessage" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.XPathParser" type="XPathParser">
@@ -3483,6 +5398,36 @@
 					<exception comment="XPath parser exception." fulltype="org.eclipse.wst.xml.xpath2.processor.XPathParserException" type="XPathParserException" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="parse" returncomment="The parsed XPath." fulltype="org.eclipse.wst.xml.xpath2.processor.ast.XPath" type="XPath">
+				<comment>
+					<description>Constructor for the XPath parser interface.</description>
+					<attribute name="@param">
+						<description>xpath
+            is the input XPath to be parsed.</description>
+					</attribute>
+					<attribute name="@param">
+						<description>isRootlessAccess
+            if &apos;true&apos; then PsychoPath engine can&apos;t parse xpath expressions starting with / or //.</description>
+					</attribute>
+					<attribute name="@throws">
+						<description>XPathParserException
+             XPath parser exception.</description>
+					</attribute>
+					<attribute name="@return">
+						<description>The parsed XPath.</description>
+					</attribute>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="xpath" comment="is the input XPath to be parsed." fulltype="java.lang.String" type="String" />
+					<param name="isRootlessAccess" comment="if &apos;true&apos; then PsychoPath engine can&apos;t parse xpath expressions starting with / or //." fulltype="boolean" type="boolean" />
+				</params>
+				<exceptions>
+					<exception comment="XPath parser exception." fulltype="org.eclipse.wst.xml.xpath2.processor.XPathParserException" type="XPathParserException" />
+				</exceptions>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass superclass="StaticError" visibility="public" package="org.eclipse.wst.xml.xpath2.processor" serializable="true" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.StaticError" fulltype="org.eclipse.wst.xml.xpath2.processor.XPathParserException" type="XPathParserException">
@@ -3585,8 +5530,14 @@
 		</methods>
 	</jelclass>
 	<jelclass superclass="XPathNode" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.ast" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode" fulltype="org.eclipse.wst.xml.xpath2.processor.ast.XPath" type="XPath">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.XPath2Expression" type="XPath2Expression" />
+		</implements>
 		<comment>
 			<description>Support for XPath.</description>
+			<attribute name="@deprecated">
+				<description>This is only for internal use, use XPath2Expression instead</description>
+			</attribute>
 		</comment>
 		<methods>
 			<constructor visibility="public" name="XPath">
@@ -3620,6 +5571,102 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getFreeVariables" fulltype="java.util.Collection" type="Collection">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="setFreeVariables" fulltype="void" type="void">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="_freeVariables" fulltype="java.util.Collection" type="Collection" />
+				</params>
+			</method>
+			<method visibility="public" name="getResolvedFunctions" fulltype="java.util.Collection" type="Collection">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="setResolvedFunctions" fulltype="void" type="void">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="_resolvedFunctions" fulltype="java.util.Collection" type="Collection" />
+				</params>
+			</method>
+			<method visibility="public" name="getAxes" fulltype="java.util.Collection" type="Collection">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="setAxes" fulltype="void" type="void">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="_axes" fulltype="java.util.Collection" type="Collection" />
+				</params>
+			</method>
+			<method visibility="public" name="isRootPathUsed" fulltype="boolean" type="boolean">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="setRootUsed" fulltype="void" type="void">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="_rootUsed" fulltype="boolean" type="boolean" />
+				</params>
+			</method>
+			<method visibility="public" name="evaluate" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
+					<param name="contextItems" fulltype="java.lang.Object[]" type="Object" />
+				</params>
+			</method>
+			<method visibility="public" name="getStaticContext" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="setStaticContext" fulltype="void" type="void">
+				<comment>
+					<attribute name="@since">
+						<description>2.0</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass superclass="FunctionLibrary" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.function" superclassfulltype="FunctionLibrary" fulltype="org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary" type="FnFunctionLibrary">
@@ -3667,26 +5714,21 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="AncestorAxis" />
-			<method visibility="public" name="iterate" returncomment="The nodes that are ancestors of the context node." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Get the ancestors of the context node.</description>
 					<attribute name="@param">
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The nodes that are ancestors of the context node.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ReverseAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.AncestorOrSelfAxis" type="AncestorOrSelfAxis">
@@ -3696,26 +5738,21 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="AncestorOrSelfAxis" />
-			<method visibility="public" name="iterate" returncomment="The context node and its ancestors." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Get ancestor nodes of the context node and the context node itself.</description>
 					<attribute name="@param">
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The context node and its ancestors.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ForwardAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.AttributeAxis" type="AttributeAxis">
@@ -3725,24 +5762,18 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="AttributeAxis" />
-			<method visibility="public" name="iterate" returncomment="The attibutes of the context node." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Retrieves the context node&apos;s attributes.</description>
 					<attribute name="@param">
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The attibutes of the context node.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
 			<method visibility="public" name="principal_node_kind" returncomment="The type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType">
@@ -3753,6 +5784,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.Axis" type="Axis">
@@ -3763,7 +5795,7 @@
  and another node that is reachable via the axis.</description>
 		</comment>
 		<methods>
-			<method visibility="public" name="iterate" returncomment="The result sequence." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Get elements and attributes.</description>
 					<attribute name="@param">
@@ -3771,16 +5803,16 @@
             is the type of node.</description>
 					</attribute>
 					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
+						<description>copyInto TODO</description>
 					</attribute>
-					<attribute name="@return">
-						<description>The result sequence.</description>
+					<attribute name="@param">
+						<description>limitNode TODO</description>
 					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" comment="TODO" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" comment="TODO" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
 			<method visibility="public" name="principal_node_kind" returncomment="The principle node kind." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType">
@@ -3791,6 +5823,14 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="name" returncomment="Axis title" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Returns the title of the sequence as it appears in the XPath source</description>
+					<attribute name="@return">
+						<description>Axis title</description>
+					</attribute>
+				</comment>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass superclass="ForwardAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis" type="ChildAxis">
@@ -3799,26 +5839,28 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="ChildAxis" />
-			<method visibility="public" name="iterate" returncomment="The context node&apos;s children." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Retrieves the context node&apos;s children.</description>
 					<attribute name="@param">
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The context node&apos;s children.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="protected" name="addChildren" fulltype="void" type="void">
+				<params>
+					<param name="node" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="recurse" fulltype="boolean" type="boolean" />
+				</params>
+			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XPathError" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" serializable="true" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.XPathError" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.CupError" type="CupError">
@@ -3865,6 +5907,9 @@
 	<jelclass superclass="ResultSequence" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.DefaultResultSequence" type="DefaultResultSequence">
 		<comment>
 			<description>Default implementation of a result sequence.</description>
+			<attribute name="@deprecated">
+				<description>use ResultBuffer instead</description>
+			</attribute>
 		</comment>
 		<methods>
 			<constructor visibility="public" name="DefaultResultSequence">
@@ -3942,6 +5987,13 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="firstValue" returncomment="first item from array _seq" fulltype="java.lang.Object" type="Object">
+				<comment>
+					<attribute name="@return">
+						<description>first item from array _seq</description>
+					</attribute>
+				</comment>
+			</method>
 			<method visibility="public" name="empty" returncomment="a boolean" fulltype="boolean" type="boolean">
 				<comment>
 					<description>Whether or not array _seq is empty</description>
@@ -3950,6 +6002,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="sequenceType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
 			<method visibility="public" name="clear" fulltype="void" type="void">
 				<comment>
 					<description>Clears the sequence.</description>
@@ -3983,7 +6036,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="schema" comment="Schema information from document. May be null." fulltype="org.apache.xerces.xs.XSModel" type="XSModel" />
+					<param name="model" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<constructor visibility="public" name="DefaultStaticContext">
@@ -4090,7 +6143,7 @@
 					<param name="arity" comment="arity of function." fulltype="int" type="int" />
 				</params>
 			</method>
-			<method visibility="protected" name="function" fulltype="Function" type="Function">
+			<method visibility="public" name="function" fulltype="Function" type="Function">
 				<params>
 					<param name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
 					<param name="arity" fulltype="int" type="int" />
@@ -4208,7 +6261,7 @@
 					<param name="elem" comment="name of element." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
 				</params>
 			</method>
-			<method visibility="public" name="element_type_definition" returncomment="schema definition of type" fulltype="org.apache.xerces.xs.XSTypeDefinition" type="XSTypeDefinition">
+			<method visibility="public" name="element_type_definition" returncomment="schema definition of type" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
 				<comment>
 					<description>Obtains schema definition of the type of an element.</description>
 					<attribute name="@param">
@@ -4238,7 +6291,7 @@
 					<param name="attr" comment="name of attribute." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
 				</params>
 			</method>
-			<method visibility="public" name="attribute_type_definition" returncomment="schema definition of the type of the attribute" fulltype="org.apache.xerces.xs.XSTypeDefinition" type="XSTypeDefinition">
+			<method visibility="public" name="attribute_type_definition" returncomment="schema definition of the type of the attribute" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
 				<comment>
 					<description>Retrieves type definition of the attribute in an element.</description>
 					<attribute name="@param">
@@ -4320,7 +6373,7 @@
 				</comment>
 				<params>
 					<param name="at" comment="node actual type." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="et" comment="type definition of expected type." fulltype="org.apache.xerces.xs.XSTypeDefinition" type="XSTypeDefinition" />
+					<param name="et" comment="type definition of expected type." fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 				</params>
 			</method>
 			<method visibility="public" name="new_scope" fulltype="void" type="void">
@@ -4383,6 +6436,12 @@
 					<param name="val" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
 			</method>
+			<method visibility="protected" name="set_variable" fulltype="void" type="void">
+				<params>
+					<param name="var" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
+					<param name="val" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
 			<method visibility="public" name="del_variable" returncomment="false if variable doesn&apos;t exist." fulltype="boolean" type="boolean">
 				<comment>
 					<description>Deletes a variable from current scope.</description>
@@ -4398,7 +6457,7 @@
 					<param name="var" comment="variable name to delete." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
 				</params>
 			</method>
-			<method visibility="protected" name="get_var" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="protected" name="get_var" fulltype="java.lang.Object" type="Object">
 				<params>
 					<param name="var" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
 				</params>
@@ -4422,6 +6481,12 @@
 				</params>
 			</method>
 			<method visibility="public" name="get_documents" fulltype="java.util.Map" type="Map" />
+			<method visibility="public" name="getTypeModel" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel">
+				<params>
+					<param name="node" fulltype="org.w3c.dom.Node" type="Node" />
+				</params>
+			</method>
+			<method visibility="public" name="get_function_libraries" fulltype="java.util.Map" type="Map" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ChildAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ChildAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis" type="DescendantAxis">
@@ -4430,26 +6495,21 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="DescendantAxis" />
-			<method visibility="public" name="iterate" returncomment="The descendants of the context node." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Using the context node retrieve the descendants of this node</description>
 					<attribute name="@param">
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The descendants of the context node.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ForwardAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis" type="DescendantOrSelfAxis">
@@ -4459,7 +6519,7 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="DescendantOrSelfAxis" />
-			<method visibility="public" name="iterate" returncomment="The context node and its descendants." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Retrieve the the descendants of the context node and the context node
  itself.</description>
@@ -4467,19 +6527,47 @@
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The context node and its descendants.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.DynamicContextAdapter" type="DynamicContextAdapter">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
+		</implements>
+		<methods>
+			<constructor visibility="public" name="DynamicContextAdapter">
+				<params>
+					<param name="dc" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+				</params>
+			</constructor>
+			<method visibility="public" name="getLimitNode" fulltype="org.w3c.dom.Node" type="Node" />
+			<method visibility="public" name="getVariable" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<params>
+					<param name="name" fulltype="javax.xml.namespace.QName" type="QName" />
+				</params>
+			</method>
+			<method visibility="public" name="resolveUri" fulltype="java.net.URI" type="URI">
+				<params>
+					<param name="uri" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getCurrentDateTime" fulltype="java.util.GregorianCalendar" type="GregorianCalendar" />
+			<method visibility="public" name="getTimezoneOffset" fulltype="javax.xml.datatype.Duration" type="Duration" />
+			<method visibility="public" name="getDocument" fulltype="org.w3c.dom.Document" type="Document">
+				<params>
+					<param name="uri" fulltype="java.net.URI" type="URI" />
+				</params>
+			</method>
+			<method visibility="public" name="getCollections" fulltype="java.util.Map" type="Map" />
+			<method visibility="public" name="getDefaultCollection" fulltype="java.util.List" type="List" />
+			<method visibility="public" name="getCollationProvider" fulltype="org.eclipse.wst.xml.xpath2.api.CollationProvider" type="CollationProvider" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.Focus" type="Focus">
@@ -4496,7 +6584,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="rs" comment="is a ResultSequence and is set to _rs." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" comment="is a ResultSequence and is set to _rs." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 			</constructor>
 			<method visibility="public" name="context_item" returncomment="the item from _rs, or null if there is no context item." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
@@ -4553,26 +6641,21 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="FollowingAxis" />
-			<method visibility="public" name="iterate" returncomment="The result of FollowingAxis." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Return the result of FollowingAxis expression</description>
 					<attribute name="@param">
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The result of FollowingAxis.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="result" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ForwardAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis" type="FollowingSiblingAxis">
@@ -4584,26 +6667,21 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="FollowingSiblingAxis" />
-			<method visibility="public" name="iterate" returncomment="The result of FollowingSiblingAxis." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>Return the result of FollowingSiblingAxis expression</description>
 					<attribute name="@param">
 						<description>node
             is the type of node.</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context.</description>
-					</attribute>
-					<attribute name="@return">
-						<description>The result of FollowingSiblingAxis.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the type of node." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context." fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis" type="ForwardAxis">
@@ -5410,7 +7488,7 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="ParentAxis" />
-			<method visibility="public" name="iterate" returncomment="the accessors." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>returns parent accessors of the context node</description>
 					<attribute name="@param">
@@ -5421,15 +7499,19 @@
 						<description>dc
              is the Dynamic context.</description>
 					</attribute>
-					<attribute name="@return">
-						<description>the accessors.</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the node type." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="findParent" fulltype="org.w3c.dom.Node" type="Node">
+				<params>
+					<param name="n" fulltype="org.w3c.dom.Node" type="Node" />
+				</params>
+			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ReverseAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.PrecedingAxis" type="PrecedingAxis">
@@ -5439,7 +7521,7 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="PrecedingAxis" />
-			<method visibility="public" name="iterate" returncomment="the descendants of the context node" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>returns preceding nodes of the context node</description>
 					<attribute name="@param">
@@ -5450,15 +7532,14 @@
 						<description>dc
              is the Dynamic context.</description>
 					</attribute>
-					<attribute name="@return">
-						<description>the descendants of the context node</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the node type." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="result" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ReverseAxis" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ReverseAxis" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.PrecedingSiblingAxis" type="PrecedingSiblingAxis">
@@ -5468,7 +7549,7 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="PrecedingSiblingAxis" />
-			<method visibility="public" name="iterate" returncomment="the descendants and the context node" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>returns preceding nodes of the context node</description>
 					<attribute name="@param">
@@ -5479,15 +7560,14 @@
 						<description>dc
              is the Dynamic context.</description>
 					</attribute>
-					<attribute name="@return">
-						<description>the descendants and the context node</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the node type." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="ResultSequence" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.RangeResultSequence" type="RangeResultSequence">
@@ -5582,6 +7662,13 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="firstValue" returncomment="first item in range" fulltype="java.lang.Object" type="Object">
+				<comment>
+					<attribute name="@return">
+						<description>first item in range</description>
+					</attribute>
+				</comment>
+			</method>
 			<method visibility="public" name="empty" returncomment="boolean" fulltype="boolean" type="boolean">
 				<comment>
 					<description>asks if the range is empty?</description>
@@ -5590,6 +7677,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="sequenceType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
 			<method visibility="public" name="release" fulltype="void" type="void">
 				<comment>
 					<description>release</description>
@@ -5622,26 +7710,21 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="SelfAxis" />
-			<method visibility="public" name="iterate" returncomment="rs containing node" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="iterate" fulltype="void" type="void">
 				<comment>
 					<description>create new rs and add the context node to it</description>
 					<attribute name="@param">
 						<description>node
             is the node type</description>
 					</attribute>
-					<attribute name="@param">
-						<description>dc
-            is the dynamic context</description>
-					</attribute>
-					<attribute name="@return">
-						<description>rs containing node</description>
-					</attribute>
 				</comment>
 				<params>
 					<param name="node" comment="is the node type" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType" />
-					<param name="dc" comment="is the dynamic context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="copyInto" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+					<param name="limitNode" fulltype="org.w3c.dom.Node" type="Node" />
 				</params>
 			</method>
+			<method visibility="public" name="name" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.SeqType" type="SeqType">
@@ -5718,8 +7801,8 @@
 				</comment>
 				<params>
 					<param name="st" comment="is a sequence type." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.SequenceType" type="SequenceType" />
-					<param name="sc" comment="is a static context." fulltype="org.eclipse.wst.xml.xpath2.processor.StaticContext" type="StaticContext" />
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="sc" comment="is a static context." fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 			</constructor>
 			<constructor visibility="public" name="SeqType">
@@ -5733,6 +7816,11 @@
 					<param name="t" comment="is an any type." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
 			</constructor>
+			<method static="true" visibility="public" name="mapSequenceTypeOccurrence" fulltype="int" type="int">
+				<params>
+					<param name="occurrence" fulltype="int" type="int" />
+				</params>
+			</method>
 			<method visibility="public" name="occurence" returncomment="an integer." fulltype="int" type="int">
 				<comment>
 					<attribute name="@return">
@@ -5747,7 +7835,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="match" returncomment="a result sequence" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="match" returncomment="a result sequence" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>matches args</description>
 					<attribute name="@param">
@@ -5763,7 +7851,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="args" comment="is a result sequence" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="args" comment="is a result sequence" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -5790,6 +7878,45 @@
 			</constructor>
 		</methods>
 	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter" type="StaticContextAdapter">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
+		</implements>
+		<methods>
+			<constructor visibility="public" name="StaticContextAdapter">
+				<params>
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.processor.StaticContext" type="StaticContext" />
+				</params>
+			</constructor>
+			<method visibility="public" name="isXPath1Compatible" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="getInScopeVariables" fulltype="org.eclipse.wst.xml.xpath2.api.StaticVariableResolver" type="StaticVariableResolver" />
+			<method visibility="public" name="getInitialContextType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getFunctionLibraries" fulltype="java.util.Map" type="Map" />
+			<method visibility="public" name="getCollationProvider" fulltype="org.eclipse.wst.xml.xpath2.api.CollationProvider" type="CollationProvider" />
+			<method visibility="public" name="getBaseUri" fulltype="java.net.URI" type="URI" />
+			<method visibility="public" name="getNamespaceContext" fulltype="javax.xml.namespace.NamespaceContext" type="NamespaceContext" />
+			<method visibility="public" name="getDefaultNamespace" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getDefaultFunctionNamespace" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getTypeModel" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
+			<method visibility="public" name="resolveFunction" fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function">
+				<params>
+					<param name="name" fulltype="javax.xml.namespace.QName" type="QName" />
+					<param name="arity" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="getCollectionType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<params>
+					<param name="collectionName" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getDefaultCollectionType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getDocumentType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<params>
+					<param name="documentUri" fulltype="java.net.URI" type="URI" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
 	<jelclass superclass="StaticNameError" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" serializable="true" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.StaticNameError" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.StaticElemNameError" type="StaticElemNameError">
 		<comment>
 			<description>Error caused by static element name.</description>
@@ -6031,16 +8158,11 @@
 			</method>
 		</methods>
 	</jelclass>
-	<jelclass superclass="Plugin" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="Plugin" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.XPath2Plugin" type="XPath2Plugin">
-		<methods>
-			<constructor visibility="public" name="XPath2Plugin" />
-		</methods>
-	</jelclass>
 	<jelclass superclass="lr_parser" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="java_cup.runtime.lr_parser" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.XPathCup" type="XPathCup">
 		<comment>
 			<description>CUP v0.10k generated parser.</description>
 			<attribute name="@version">
-				<description>Mon Dec 14 02:02:22 CET 2009</description>
+				<description>Fri Jun 25 01:11:06 CEST 2010</description>
 			</attribute>
 		</comment>
 		<fields>
@@ -6170,6 +8292,37 @@
 			</method>
 		</methods>
 	</jelclass>
+	<jelclass superclass="XPathCup" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.XPathCup" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.XPathCupRestricted" type="XPathCupRestricted">
+		<methods>
+			<constructor visibility="public" name="XPathCupRestricted">
+				<comment>
+					<description>Default constructor.</description>
+				</comment>
+			</constructor>
+			<constructor visibility="public" name="XPathCupRestricted">
+				<comment>
+					<description>Constructor which sets the default scanner.</description>
+				</comment>
+				<params>
+					<param name="s" fulltype="java_cup.runtime.Scanner" type="java_cup.runtime.Scanner" />
+				</params>
+			</constructor>
+			<method visibility="public" name="do_action" fulltype="java_cup.runtime.Symbol" type="java_cup.runtime.Symbol">
+				<comment>
+					<description>Invoke a user supplied parse action.</description>
+				</comment>
+				<params>
+					<param name="act_num" fulltype="int" type="int" />
+					<param name="parser" fulltype="java_cup.runtime.lr_parser" type="java_cup.runtime.lr_parser" />
+					<param name="stack" fulltype="java.util.Stack" type="Stack" />
+					<param name="top" fulltype="int" type="int" />
+				</params>
+				<exceptions>
+					<exception fulltype="java.lang.Exception" type="Exception" />
+				</exceptions>
+			</method>
+		</methods>
+	</jelclass>
 	<jelclass superclass="Error" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal" serializable="true" superclassfulltype="java.lang.Error" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.XPathError" type="XPathError">
 		<comment>
 			<description>This error is thrown when there is a problem with an XPath exception.</description>
@@ -6534,7 +8687,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -6685,7 +8839,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="isWild" fulltype="boolean" type="boolean" />
@@ -6853,6 +9008,12 @@
 					<param name="r" comment="SingleType to cast l to." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType" type="SingleType" />
 				</params>
 			</constructor>
+			<method visibility="public" name="function" fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function" />
+			<method visibility="public" name="set_function" fulltype="void" type="void">
+				<params>
+					<param name="_function" fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function" />
+				</params>
+			</method>
 			<method visibility="public" name="accept" returncomment="Result of Visitor operation." fulltype="java.lang.Object" type="Object">
 				<comment>
 					<description>Support for Visitor interface.</description>
@@ -7066,7 +9227,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -7228,7 +9390,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -7374,7 +9537,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="isWild" fulltype="boolean" type="boolean" />
@@ -7718,6 +9882,12 @@
 					<param name="args" comment="Collection of arguments." fulltype="java.util.Collection" type="Collection" />
 				</params>
 			</constructor>
+			<method visibility="public" name="function" fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function" />
+			<method visibility="public" name="set_function" fulltype="void" type="void">
+				<params>
+					<param name="_function" fulltype="org.eclipse.wst.xml.xpath2.api.Function" type="Function" />
+				</params>
+			</method>
 			<method visibility="public" name="accept" returncomment="Result of Visitor operation." fulltype="java.lang.Object" type="Object">
 				<comment>
 					<description>Support for Visitor interface.</description>
@@ -8049,7 +10219,8 @@
 			<constructor visibility="public" name="KindTest" />
 			<method abstract="true" visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method abstract="true" visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -8297,7 +10468,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -8673,7 +10845,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -8719,7 +10892,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="isWild" fulltype="boolean" type="boolean" />
@@ -8802,6 +10976,11 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="isLengthValid" fulltype="boolean" type="boolean">
+				<params>
+					<param name="length" fulltype="int" type="int" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass superclass="XPathNode" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.ast" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.ast.SingleType" type="SingleType">
@@ -9002,7 +11181,8 @@
 			</method>
 			<method visibility="public" name="createTestType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+					<param name="sc" fulltype="org.eclipse.wst.xml.xpath2.api.StaticContext" type="StaticContext" />
 				</params>
 			</method>
 			<method visibility="public" name="name" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName" />
@@ -9711,9 +11891,15 @@
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence" type="SingleItemSequence" />
+		</implements>
 		<comment>
 			<description>Common base for every type</description>
 		</comment>
+		<fields>
+			<field static="true" visibility="protected" name="_datatypeFactory" fulltype="javax.xml.datatype.DatatypeFactory" type="DatatypeFactory" />
+		</fields>
 		<methods>
 			<constructor visibility="public" name="AnyType" />
 			<method abstract="true" visibility="public" name="string_type" returncomment="Datatype&apos;s full pathname" fulltype="java.lang.String" type="String">
@@ -9724,20 +11910,55 @@
 					</attribute>
 				</comment>
 			</method>
-			<method abstract="true" visibility="public" name="string_value" returncomment="Datatype&apos;s name" fulltype="java.lang.String" type="String">
+			<method abstract="true" visibility="public" name="getStringValue" returncomment="Value as a string" fulltype="java.lang.String" type="String">
 				<comment>
-					<description>Retrieves the datatype&apos;s name</description>
+					<description>Retrieves the datatype&apos;s text representation</description>
 					<attribute name="@return">
-						<description>Datatype&apos;s name</description>
+						<description>Value as a string</description>
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="string_value" fulltype="java.lang.String" type="String" />
+			<method abstract="true" visibility="public" name="getTypeDefinition" returncomment="Type definition (possibly backed by a schema type)" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>Returns the &quot;new style&quot; of TypeDefinition for this item.</description>
+					<attribute name="@return">
+						<description>Type definition (possibly backed by a schema type)</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="empty" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="iterator" fulltype="java.util.Iterator" type="Iterator" />
+			<method visibility="public" name="getItemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
+			<method abstract="true" visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
+			<method visibility="public" name="size" fulltype="int" type="int" />
+			<method visibility="public" name="item" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="value" fulltype="java.lang.Object" type="Object">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="itemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType">
+				<params>
+					<param name="index" fulltype="int" type="int" />
+				</params>
+			</method>
+			<method visibility="public" name="first" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
+			<method visibility="public" name="firstValue" fulltype="java.lang.Object" type="Object" />
+			<method visibility="public" name="sequenceType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType" type="ItemType" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NodeType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AttrType" type="AttrType">
 		<comment>
 			<description>A representation of the AttributeType datatype</description>
 		</comment>
+		<fields>
+			<field visibility="package-private" name="_value" fulltype="org.w3c.dom.Attr" type="Attr" />
+		</fields>
 		<methods>
 			<constructor visibility="public" name="AttrType">
 				<comment>
@@ -9754,6 +11975,7 @@
 				</comment>
 				<params>
 					<param name="v" comment="The attribute being represented" fulltype="org.w3c.dom.Attr" type="Attr" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<method visibility="public" name="string_type" returncomment="&quot;attribute&quot; which is the datatype&apos;s full pathname" fulltype="java.lang.String" type="String">
@@ -9764,7 +11986,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the attribute being stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the attribute being stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the attribute being stored</description>
 					<attribute name="@return">
@@ -9772,7 +11994,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the attribute being stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the attribute being stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the attribute being stored</description>
 					<attribute name="@return">
@@ -9788,7 +12010,14 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="isID" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="isID" fulltype="boolean" type="boolean">
+				<comment>
+					<description>Checks if the current node is of type ID</description>
+					<attribute name="@since">
+						<description>1.1;</description>
+					</attribute>
+				</comment>
+			</method>
 			<method visibility="public" name="isIDREF" fulltype="boolean" type="boolean">
 				<comment>
 					<attribute name="@since">
@@ -9801,6 +12030,7 @@
 					<param name="typeName" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" type="CalendarType">
@@ -9809,6 +12039,7 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="CalendarType" />
+			<method abstract="true" visibility="public" name="calendar" fulltype="java.util.Calendar" type="Calendar" />
 			<method visibility="public" name="normalizeCalendar" fulltype="java.util.Calendar" type="Calendar">
 				<params>
 					<param name="cal" fulltype="java.util.Calendar" type="Calendar" />
@@ -9820,6 +12051,7 @@
 					<param name="aat" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
 			</method>
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NodeType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CommentType" type="CommentType">
@@ -9837,6 +12069,7 @@
 				</comment>
 				<params>
 					<param name="v" comment="The comment being represented" fulltype="org.w3c.dom.Comment" type="Comment" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<method visibility="public" name="string_type" returncomment="&quot;comment&quot; which is the datatype&apos;s full pathname" fulltype="java.lang.String" type="String">
@@ -9847,7 +12080,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the comment being stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the comment being stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the comment being stored</description>
 					<attribute name="@return">
@@ -9855,7 +12088,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the comment stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the comment stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the comment stored</description>
 					<attribute name="@return">
@@ -9885,6 +12118,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="AnyAtomicType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" type="CtrType">
@@ -9893,7 +12127,7 @@
 		</comment>
 		<methods>
 			<constructor visibility="public" name="CtrType" />
-			<method abstract="true" visibility="public" name="constructor" returncomment="The resulting ResultSequence" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method abstract="true" visibility="public" name="constructor" returncomment="The resulting ResultSequence" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Used for constructor function.</description>
 					<attribute name="@param">
@@ -9905,7 +12139,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="Either an empty sequence or 1 atomic type" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="Either an empty sequence or 1 atomic type" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -9919,6 +12153,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NodeType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.DocType" type="DocType">
@@ -9936,6 +12171,7 @@
 				</comment>
 				<params>
 					<param name="v" comment="The document being represented" fulltype="org.w3c.dom.Document" type="Document" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<method visibility="public" name="value" returncomment="Actual document being represented" fulltype="org.w3c.dom.Document" type="Document">
@@ -9954,7 +12190,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the document being stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the document being stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the document being stored</description>
 					<attribute name="@return">
@@ -9962,7 +12198,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the document being stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the document being stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the document being stored</description>
 					<attribute name="@return">
@@ -9992,6 +12228,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NodeType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType" type="ElementType">
@@ -10014,25 +12251,7 @@
 				</comment>
 				<params>
 					<param name="v" comment="The element being represented" fulltype="org.w3c.dom.Element" type="Element" />
-				</params>
-			</constructor>
-			<constructor visibility="public" name="ElementType">
-				<comment>
-					<description>This deprecated and will be removed. Adopters need to use
- ElementType(Element)</description>
-					<attribute name="@param">
-						<description>v</description>
-					</attribute>
-					<attribute name="@param">
-						<description>nodePosition</description>
-					</attribute>
-					<attribute name="@deprecated">
-						<description>Use ElementType(Element v) instead.</description>
-					</attribute>
-				</comment>
-				<params>
-					<param name="v" comment="" fulltype="org.w3c.dom.Element" type="Element" />
-					<param name="nodePosition" comment="" fulltype="int" type="int" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<method visibility="public" name="value" returncomment="Actual element value being represented" fulltype="org.w3c.dom.Element" type="Element">
@@ -10051,7 +12270,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the element being stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the element being stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the element being stored</description>
 					<attribute name="@return">
@@ -10059,7 +12278,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the element stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the element stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the element stored</description>
 					<attribute name="@return">
@@ -10090,7 +12309,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="nilled" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+			<method visibility="public" name="nilled" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 			<method visibility="public" name="isID" fulltype="boolean" type="boolean">
 				<comment>
 					<attribute name="@since">
@@ -10110,6 +12329,39 @@
 					<param name="typeName" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeItemTypeImpl" type="NodeItemTypeImpl">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType" type="NodeItemType" />
+		</implements>
+		<methods>
+			<constructor visibility="public" name="NodeItemTypeImpl">
+				<params>
+					<param name="occurrence" fulltype="short" type="short" />
+					<param name="nodeType" fulltype="short" type="short" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="NodeItemTypeImpl">
+				<params>
+					<param name="nodeType" fulltype="short" type="short" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="NodeItemTypeImpl">
+				<params>
+					<param name="occurrence" fulltype="short" type="short" />
+					<param name="nodeType" fulltype="short" type="short" />
+					<param name="typeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+					<param name="name" fulltype="javax.xml.namespace.QName" type="QName" />
+					<param name="wildcard" fulltype="boolean" type="boolean" />
+				</params>
+			</constructor>
+			<method visibility="public" name="getOccurrence" fulltype="short" type="short" />
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="isWildcard" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="getName" fulltype="javax.xml.namespace.QName" type="QName" />
+			<method visibility="public" name="getNodeType" fulltype="short" type="short" />
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="AnyType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType">
@@ -10119,6 +12371,8 @@
 		<fields>
 			<field final="true" static="true" const="IDREF" visibility="protected" name="SCHEMA_TYPE_IDREF" constexpr="&quot;IDREF&quot;" fulltype="java.lang.String" type="String" />
 			<field final="true" static="true" const="ID" visibility="protected" name="SCHEMA_TYPE_ID" constexpr="&quot;ID&quot;" fulltype="java.lang.String" type="String" />
+			<field visibility="protected" name="_typeModel" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
+			<field final="true" static="true" visibility="public" name="NODE_COMPARATOR" fulltype="java.util.Comparator" type="Comparator" />
 		</fields>
 		<methods>
 			<constructor visibility="public" name="NodeType">
@@ -10135,6 +12389,7 @@
 				</comment>
 				<params>
 					<param name="node" comment="The Node being represented" fulltype="org.w3c.dom.Node" type="Node" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<method visibility="public" name="node_value" returncomment="Actual node being represented" fulltype="org.w3c.dom.Node" type="Node">
@@ -10145,7 +12400,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method abstract="true" visibility="public" name="typed_value" returncomment="Actual node being represented" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method abstract="true" visibility="public" name="typed_value" returncomment="Actual node being represented" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Retrieves the actual node being represented</description>
 					<attribute name="@return">
@@ -10161,10 +12416,11 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="nilled" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+			<method visibility="public" name="nilled" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 			<method static="true" visibility="public" name="dom_to_xpath" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" type="NodeType">
 				<params>
 					<param name="node" fulltype="org.w3c.dom.Node" type="Node" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</method>
 			<method static="true" visibility="public" name="eliminate_dups" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
@@ -10207,7 +12463,13 @@
 			</method>
 			<method visibility="protected" name="getTypedValueForPrimitiveType" fulltype="java.lang.Object" type="Object">
 				<params>
-					<param name="typeDef" fulltype="org.apache.xerces.xs.XSTypeDefinition" type="XSTypeDefinition" />
+					<param name="typeDef" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+				</params>
+			</method>
+			<method visibility="protected" name="getXDMTypedValue" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<params>
+					<param name="typeDef" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+					<param name="itemValTypes" fulltype="java.util.List" type="List" />
 				</params>
 			</method>
 			<method abstract="true" visibility="public" name="isID" fulltype="boolean" type="boolean" />
@@ -10228,6 +12490,21 @@
 					<param name="typeName" comment="" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
+			<method visibility="protected" name="getType" returncomment="TypeDefinition, or null" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition">
+				<comment>
+					<description>Looks up the available type for the node, if available</description>
+					<attribute name="@return">
+						<description>TypeDefinition, or null</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
+			<method visibility="public" name="getTypeModel" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
+			<method static="true" visibility="public" name="linarize" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer">
+				<params>
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultBuffer" type="ResultBuffer" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass abstract="true" superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType" type="NumericType">
@@ -10244,7 +12521,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method abstract="true" visibility="public" name="unary_minus" returncomment="New ResultSequence representing the negation of the number stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method abstract="true" visibility="public" name="unary_minus" returncomment="New ResultSequence representing the negation of the number stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence representing the negation of the number
  stored</description>
@@ -10302,15 +12579,15 @@
 					<param name="precision" fulltype="int" type="int" />
 				</params>
 			</method>
-			<method visibility="protected" name="get_single_arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="protected" name="get_single_arg" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
 				<params>
-					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method static="true" visibility="public" name="get_single_type" returncomment="The node being tested" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method static="true" visibility="public" name="get_single_type" returncomment="The node being tested" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
 				<comment>
 					<description>Check whether the supplied node is of the supplied type</description>
 					<attribute name="@param">
@@ -10330,13 +12607,22 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="at" comment="The node being tested" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
+					<param name="at" comment="The node being tested" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
 					<param name="type" comment="The type expected" fulltype="java.lang.Class" type="Class" />
 				</params>
 				<exceptions>
 					<exception comment="If node being tested is not of expected type" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method static="true" visibility="public" name="get_single_type" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
+				<params>
+					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
+					<param name="type" fulltype="java.lang.Class" type="Class" />
+				</params>
+				<exceptions>
+					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
+				</exceptions>
+			</method>
 			<method static="true" visibility="public" name="get_single_type" returncomment="The node being tested" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
 				<comment>
 					<description>Check whether first node in supplied ResultSequence is of the supplied
@@ -10358,7 +12644,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="rs" comment="The node being tested" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="rs" comment="The node being tested" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 					<param name="type" comment="The type expected" fulltype="java.lang.Class" type="Class" />
 				</params>
 				<exceptions>
@@ -10386,6 +12672,7 @@
 				</comment>
 				<params>
 					<param name="v" comment="The processing instruction this node represents" fulltype="org.w3c.dom.ProcessingInstruction" type="ProcessingInstruction" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<method visibility="public" name="value" returncomment="Actual processing instruction this node represents" fulltype="org.w3c.dom.ProcessingInstruction" type="ProcessingInstruction">
@@ -10404,7 +12691,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the actual processing instruction stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the actual processing instruction stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the actual processing instruction
  stored</description>
@@ -10414,7 +12701,7 @@
 				</comment>
 			</method>
 			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the processing instruction
-         stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the processing instruction
  stored</description>
@@ -10446,6 +12733,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName">
@@ -10509,6 +12797,11 @@
 					<description>Initialises with a null prefix and null node name</description>
 				</comment>
 			</constructor>
+			<constructor visibility="public" name="QName">
+				<params>
+					<param name="name" fulltype="javax.xml.namespace.QName" type="QName" />
+				</params>
+			</constructor>
 			<method static="true" visibility="public" name="parse_QName" returncomment="null" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.QName" type="QName">
 				<comment>
 					<description>Creates a new QName by parsing a String representation of the node name</description>
@@ -10524,7 +12817,7 @@
 					<param name="str" comment="String representation of the name" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the QName supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the QName supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable QName in the
  supplied ResultSequence</description>
@@ -10540,13 +12833,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to extract from" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to extract from" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the node name" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the node name" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the node name. This method is
  functionally identical to string()</description>
@@ -10673,13 +12966,51 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The QName to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="toString" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="asQName" fulltype="javax.xml.namespace.QName" type="QName" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.SchemaTypeValueFactory" type="SchemaTypeValueFactory">
+		<comment>
+			<description>A factory class implementation, to construct PsychoPath schema type representation corresponding 
+ to XML Schema types.</description>
+		</comment>
+		<methods>
+			<constructor visibility="public" name="SchemaTypeValueFactory" />
+			<method static="true" visibility="public" name="newSchemaTypeValue" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+				<params>
+					<param name="typeDef" fulltype="short" type="short" />
+					<param name="strValue" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl" type="SimpleAtomicItemTypeImpl">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.AtomicItemType" type="AtomicItemType" />
+		</implements>
+		<methods>
+			<constructor visibility="public" name="SimpleAtomicItemTypeImpl">
+				<params>
+					<param name="typeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="SimpleAtomicItemTypeImpl">
+				<params>
+					<param name="typeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+					<param name="occurrence" fulltype="short" type="short" />
+				</params>
+			</constructor>
+			<method visibility="public" name="getOccurrence" fulltype="short" type="short" />
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NodeType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.TextType" type="TextType">
@@ -10697,6 +13028,7 @@
 				</comment>
 				<params>
 					<param name="v" comment="The value of the TextType node" fulltype="org.w3c.dom.Text" type="Text" />
+					<param name="tm" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
 				</params>
 			</constructor>
 			<method visibility="public" name="string_type" returncomment="&quot;text&quot; which is the datatype&apos;s name" fulltype="java.lang.String" type="String">
@@ -10707,7 +13039,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the actual value stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the actual value stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the actual value stored</description>
 					<attribute name="@return">
@@ -10715,7 +13047,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the Text value stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="typed_value" returncomment="New ResultSequence consisting of the Text value stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the Text value stored</description>
 					<attribute name="@return">
@@ -10746,6 +13078,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="DecimalFormat" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" serializable="true" superclassfulltype="java.text.DecimalFormat" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XPathDecimalFormat" type="XPathDecimalFormat">
@@ -10831,7 +13164,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="new result sequence consisting of the URI supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="new result sequence consisting of the URI supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creation of a result sequence consisting of a URI from a previous result
  sequence.</description>
@@ -10847,7 +13180,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="previous result sequence" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="previous result sequence" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -10872,7 +13205,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The representation to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -10888,7 +13221,7 @@
 				</comment>
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -10904,12 +13237,14 @@
 				</comment>
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getStringValue" fulltype="java.lang.String" type="String" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSBase64Binary" type="XSBase64Binary">
@@ -10950,7 +13285,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="The base64Binary stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="The base64Binary stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the base64Binary stored. This method is
  functionally identical to value()</description>
@@ -10968,7 +13303,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence representing base64Binary value" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence representing base64Binary value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the base64Binary value</description>
 					<attribute name="@param">
@@ -10983,7 +13318,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to construct base64Binary value" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to construct base64Binary value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11006,18 +13341,24 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The representation to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean" type="XSBoolean">
 		<comment>
 			<description>A representation of a true or a false value.</description>
 		</comment>
+		<fields>
+			<field final="true" static="true" visibility="public" name="TRUE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean" type="XSBoolean" />
+			<field final="true" static="true" visibility="public" name="FALSE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean" type="XSBoolean" />
+		</fields>
 		<methods>
 			<constructor visibility="public" name="XSBoolean">
 				<comment>
@@ -11044,6 +13385,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 			<method visibility="public" name="type_name" returncomment="&quot;boolean&quot;, which is the datatype name." fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieve the datatype name</description>
@@ -11052,7 +13394,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="the String representation of the boolean value stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="the String representation of the boolean value stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieve the String representation of the boolean value stored</description>
 					<attribute name="@return">
@@ -11068,7 +13410,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the boolean value supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the boolean value supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new result sequence consisting of the retrievable boolean value
  in the supplied result sequence</description>
@@ -11084,7 +13426,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The result sequence from which to extract the boolean value." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The result sequence from which to extract the boolean value." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11112,7 +13454,7 @@
 				<params>
 					<param name="arg" comment="The XSBoolean representation of the boolean value to compare
             with." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11140,7 +13482,7 @@
 				<params>
 					<param name="arg" comment="The XSBoolean representation of the boolean value to compare
             with." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11168,12 +13510,18 @@
 				<params>
 					<param name="arg" comment="The XSBoolean representation of the boolean value to compare
             with." fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method static="true" visibility="public" name="valueOf" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<params>
+					<param name="answer" fulltype="boolean" type="boolean" />
+				</params>
+			</method>
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSShort" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSByte" type="XSByte">
@@ -11211,7 +13559,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;byte&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;byte&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable &apos;byte&apos; in the
  supplied ResultSequence</description>
@@ -11227,12 +13575,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the byte is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the byte is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate" type="XSDate">
@@ -11301,7 +13650,7 @@
 					<param name="str" comment="The String representation of the date (and optional timezone)" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the date value supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the date value supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new result sequence consisting of the retrievable date value in
  the supplied result sequence</description>
@@ -11317,7 +13666,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The result sequence from which to extract the date value." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The result sequence from which to extract the date value." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11357,7 +13706,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the date stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the date stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the date stored</description>
 					<attribute name="@return">
@@ -11408,7 +13757,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="XSDate representation of the date to compare to" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11432,7 +13781,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="XSDate representation of the date to compare to" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11456,7 +13805,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="XSDate representation of the date to compare to" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11472,7 +13821,7 @@
 				</comment>
 			</method>
 			<method visibility="public" name="minus" returncomment="New ResultSequence consisting of the result of the mathematical
-         minus operation." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         minus operation." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical minus operator between this XSDate and a supplied result
  sequence (XSDate, XSYearMonthDuration and XSDayTimeDuration are only
@@ -11497,14 +13846,14 @@
             XSDayTimeDuration of the duration of time between these two
             dates. If arg is an XSYearMonthDuration or an
             XSDayTimeDuration the result will be a XSDate of the result of
-            the current date minus the duration of time supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            the current date minus the duration of time supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="plus" returncomment="New ResultSequence consisting of the result of the mathematical
-         minus operation." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         minus operation." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition operator between this XSDate and a supplied result
  sequence (XDTYearMonthDuration and XDTDayTimeDuration are only valid
@@ -11525,12 +13874,13 @@
 					<param name="arg" comment="The supplied ResultSequence that is on the right of the minus
             operator. If arg is an XDTYearMonthDuration or an
             XDTDayTimeDuration the result will be a XSDate of the result
-            of the current date minus the duration of time supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            of the current date minus the duration of time supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateTime" type="XSDateTime">
@@ -11672,7 +14022,7 @@
 				</params>
 			</method>
 			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the date and time value
-         supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new result sequence consisting of the retrievable date and time
  value in the supplied result sequence</description>
@@ -11691,7 +14041,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The result sequence from which to extract the date and time
-            value." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            value." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11767,7 +14117,7 @@
 					<param name="len" comment="Desired length after padding" fulltype="int" type="int" />
 				</params>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the date and time stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the date and time stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the date and time stored</description>
 					<attribute name="@return">
@@ -11810,7 +14160,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="XSDateTime representation of the date to compare to" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11835,7 +14185,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="XSDateTime representation of the date to compare to" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11860,7 +14210,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="XSDateTime representation of the date to compare to" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -11884,7 +14234,7 @@
 				</comment>
 			</method>
 			<method visibility="public" name="minus" returncomment="New ResultSequence consisting of the result of the mathematical
-         minus operation." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         minus operation." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical minus operator between this XSDateTime and a supplied result
  sequence (XSDateTime, XDTYearMonthDuration and XDTDayTimeDuration are
@@ -11911,14 +14261,14 @@
             dates. If arg is an XDTYearMonthDuration or an
             XDTDayTimeDuration the result will be a XSDateTime of the
             result of the current date minus the duration of time
-            supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="plus" returncomment="New ResultSequence consisting of the result of the mathematical
-         minus operation." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         minus operation." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition operator between this XSDateTime and a supplied
  result sequence (XDTYearMonthDuration and XDTDayTimeDuration are only
@@ -11941,12 +14291,13 @@
             operator. If arg is an XDTYearMonthDuration or an
             XDTDayTimeDuration the result will be a XSDateTime of the
             result of the current date minus the duration of time
-            supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSDuration" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDayTimeDuration" type="XSDayTimeDuration">
@@ -12010,6 +14361,11 @@
 					<description>Initialises to a duration of no time (0days, 0hours, 0minutes, 0seconds)</description>
 				</comment>
 			</constructor>
+			<constructor visibility="public" name="XSDayTimeDuration">
+				<params>
+					<param name="d" fulltype="javax.xml.datatype.Duration" type="Duration" />
+				</params>
+			</constructor>
 			<method visibility="public" name="clone" returncomment="New XSDayTimeDuration representing the duration of time stored" fulltype="java.lang.Object" type="Object">
 				<comment>
 					<description>Creates a copy of this representation of a time duration</description>
@@ -12024,9 +14380,9 @@
 					<exception comment="" fulltype="java.lang.CloneNotSupportedException" type="CloneNotSupportedException" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<params>
-					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -12065,7 +14421,7 @@
 				</comment>
 			</method>
 			<method visibility="public" name="plus" returncomment="New XSDayTimeDuration representing the resulting duration after
-         the addition" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         the addition" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition between this duration stored and the supplied
  duration of time (of type XSDayTimeDuration)</description>
@@ -12082,14 +14438,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to add" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to add" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="minus" returncomment="New XSDayTimeDuration representing the resulting duration after
-         the subtraction" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         the subtraction" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical subtraction between this duration stored and the supplied
  duration of time (of type XSDayTimeDuration)</description>
@@ -12106,14 +14462,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to subtract" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to subtract" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="times" returncomment="New XSDayTimeDuration representing the resulting duration after
-         the multiplication" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         the multiplication" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical multiplication between this duration stored and the supplied
  duration of time (of type XSDayTimeDuration)</description>
@@ -12130,14 +14486,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to multiply by" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to multiply by" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="div" returncomment="New XSDayTimeDuration representing the resulting duration after
-         the division" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         the division" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical division between this duration stored and the supplied
  duration of time (of type XSDayTimeDuration)</description>
@@ -12154,12 +14510,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to divide by" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to divide by" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NumericType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal" type="XSDecimal">
@@ -12205,7 +14562,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the Decimal value stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the Decimal value stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the Decimal value stored</description>
 					<attribute name="@return">
@@ -12221,7 +14578,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the decimal number supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the decimal number supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new result sequence consisting of the retrievable decimal
  number in the supplied result sequence</description>
@@ -12237,7 +14594,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The result sequence from which to extract the decimal number." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The result sequence from which to extract the decimal number." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -12289,7 +14646,7 @@
 				<params>
 					<param name="at" comment="Representation to be compared with (must currently be of type
             XSDecimal)" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -12312,13 +14669,13 @@
 				<params>
 					<param name="arg" comment="Representation to be compared with (must currently be of type
             XSDecimal)" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
@@ -12343,14 +14700,14 @@
 				<params>
 					<param name="arg" comment="Representation to be compared with (must currently be of type
             XSDecimal)" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="plus" returncomment="A XSDecimal consisting of the result of the mathematical
-         addition." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         addition." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition operator between this XSDecimal and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
@@ -12365,14 +14722,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="minus" returncomment="A XSDecimal consisting of the result of the mathematical
-         subtraction." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         subtraction." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical subtraction operator between this XSDecimal and the supplied
  ResultSequence.</description>
@@ -12386,14 +14743,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a subtraction with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a subtraction with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="times" returncomment="A XSDecimal consisting of the result of the mathematical
-         multiplication." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         multiplication." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical multiplication operator between this XSDecimal and the
  supplied ResultSequence.</description>
@@ -12407,14 +14764,11 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a multiplication with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a multiplication with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
-				<exceptions>
-					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
-				</exceptions>
 			</method>
 			<method visibility="public" name="div" returncomment="A XSDecimal consisting of the result of the mathematical
-         division." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         division." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical division operator between this XSDecimal and the supplied
  ResultSequence.</description>
@@ -12428,14 +14782,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a division with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a division with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="idiv" returncomment="A XSInteger consisting of the result of the mathematical integer
-         division." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         division." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical integer division operator between this XSDecimal and the
  supplied ResultSequence. Due to no numeric type promotion or conversion,
@@ -12450,13 +14804,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an integer division with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an integer division with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="mod" returncomment="A XSDecimal consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="mod" returncomment="A XSDecimal consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical modulus operator between this XSDecimal and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
@@ -12470,13 +14824,19 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="unary_minus" returncomment="A XSDecimal representing the negation of this XSDecimal" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method static="true" visibility="public" name="remainder" fulltype="java.math.BigDecimal" type="BigDecimal">
+				<params>
+					<param name="value" fulltype="java.math.BigDecimal" type="BigDecimal" />
+					<param name="divisor" fulltype="java.math.BigDecimal" type="BigDecimal" />
+				</params>
+			</method>
+			<method visibility="public" name="unary_minus" returncomment="A XSDecimal representing the negation of this XSDecimal" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Negation of the number stored</description>
 					<attribute name="@return">
@@ -12542,6 +14902,8 @@
 					<param name="precision" comment="An integer precision" fulltype="int" type="int" />
 				</params>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NumericType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble" type="XSDouble">
@@ -12596,7 +14958,7 @@
 					<param name="i" comment="String representation of the number to be stored" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the double number supplied." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="A new result sequence consisting of the double number supplied." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new result sequence consisting of the retrievable double number
  in the supplied result sequence</description>
@@ -12612,7 +14974,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The result sequence from which to extract the double number." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The result sequence from which to extract the double number." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -12634,7 +14996,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the Decimal value stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the Decimal value stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the Decimal value stored</description>
 					<attribute name="@return">
@@ -12695,7 +15057,7 @@
 				<params>
 					<param name="aa" comment="Representation to be compared with (must currently be of type
             XSDouble)" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -12718,13 +15080,13 @@
 				<params>
 					<param name="arg" comment="Representation to be compared with (must currently be of type
             XSDouble)" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
@@ -12751,13 +15113,13 @@
 				<params>
 					<param name="arg" comment="Representation to be compared with (must currently be of type
             XSDouble)" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="plus" returncomment="A XSDouble consisting of the result of the mathematical addition." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="plus" returncomment="A XSDouble consisting of the result of the mathematical addition." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition operator between this XSDouble and the supplied
  ResultSequence.</description>
@@ -12770,14 +15132,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="minus" returncomment="A XSDouble consisting of the result of the mathematical
-         subtraction." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         subtraction." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical subtraction operator between this XSDouble and the supplied
  ResultSequence.</description>
@@ -12791,14 +15153,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an subtraction with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an subtraction with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="times" returncomment="A XSDouble consisting of the result of the mathematical
-         multiplication." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         multiplication." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical multiplication operator between this XSDouble and the
  supplied ResultSequence. Due to no numeric type promotion or conversion,
@@ -12813,13 +15175,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an multiplication with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an multiplication with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="div" returncomment="A XSDouble consisting of the result of the mathematical division." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="div" returncomment="A XSDouble consisting of the result of the mathematical division." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical division operator between this XSDouble and the supplied
  ResultSequence.</description>
@@ -12832,14 +15194,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an division with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an division with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="idiv" returncomment="A XSInteger consisting of the result of the mathematical integer
-         division." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         division." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical integer division operator between this XSDouble and the
  supplied ResultSequence.</description>
@@ -12853,13 +15215,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an integer division with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an integer division with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="mod" returncomment="A XSDouble consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="mod" returncomment="A XSDouble consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical modulus operator between this XSDouble and the supplied
  ResultSequence.</description>
@@ -12872,13 +15234,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="unary_minus" returncomment="A XSDouble representing the negation of this XSDecimal" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="unary_minus" returncomment="A XSDouble representing the negation of this XSDecimal" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Negation of the number stored</description>
 					<attribute name="@return">
@@ -12946,6 +15308,8 @@
 					<param name="precision" comment="An integer precision" fulltype="int" type="int" />
 				</params>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration" type="XSDuration">
@@ -13035,7 +15399,7 @@
 			</constructor>
 			<method visibility="public" name="type_name" fulltype="java.lang.String" type="String" />
 			<method visibility="public" name="string_type" fulltype="java.lang.String" type="String" />
-			<method visibility="public" name="string_value" returncomment="String representation of the duration stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the duration stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the duration stored</description>
 					<attribute name="@return">
@@ -13093,7 +15457,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The duration of time to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13117,7 +15481,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The duration of time to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13141,7 +15505,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The duration of time to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13167,7 +15531,7 @@
 				</comment>
 			</method>
 			<method visibility="public" name="time_value" fulltype="double" type="double" />
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the time duration extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the time duration extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable time duration
  from the supplied ResultSequence</description>
@@ -13183,7 +15547,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to extract" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to extract" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13231,6 +15595,8 @@
 					<param name="aat" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType" type="AnyAtomicType" />
 				</params>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSNCName" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSEntity" type="XSEntity">
@@ -13252,7 +15618,7 @@
 			</constructor>
 			<method visibility="public" name="string_type" fulltype="java.lang.String" type="String" />
 			<method visibility="public" name="type_name" fulltype="java.lang.String" type="String" />
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the ENTITY supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the ENTITY supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the ENTITY within
  the supplied ResultSequence.  The specification says that this
@@ -13271,12 +15637,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to extract the ENTITY" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to extract the ENTITY" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="NumericType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSFloat" type="XSFloat">
@@ -13332,7 +15699,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the stored number" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the stored number" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the stored number</description>
 					<attribute name="@return">
@@ -13365,7 +15732,7 @@
 				</comment>
 			</method>
 			<method visibility="public" name="negativeZero" fulltype="boolean" type="boolean" />
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the float supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the float supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the retrievable float in the
  supplied ResultSequence</description>
@@ -13381,7 +15748,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to extract the float" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to extract the float" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13413,7 +15780,7 @@
 				</comment>
 				<params>
 					<param name="aa" comment="The datatype to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13437,7 +15804,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The datatype to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13461,13 +15828,13 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The datatype to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="plus" returncomment="A XSFloat consisting of the result of the mathematical addition." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="plus" returncomment="A XSFloat consisting of the result of the mathematical addition." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition operator between this XSFloat and the supplied
  ResultSequence.</description>
@@ -13480,14 +15847,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="minus" returncomment="A XSFloat consisting of the result of the mathematical
-         subtraction." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         subtraction." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical subtraction operator between this XSFloat and the supplied
  ResultSequence.</description>
@@ -13501,14 +15868,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a subtraction with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a subtraction with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="times" returncomment="A XSFloat consisting of the result of the mathematical
-         multiplication." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         multiplication." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical multiplication operator between this XSFloat and the
  supplied ResultSequence.</description>
@@ -13522,13 +15889,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a multiplication with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a multiplication with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="div" returncomment="A XSFloat consisting of the result of the mathematical division." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="div" returncomment="A XSFloat consisting of the result of the mathematical division." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical division operator between this XSFloat and the supplied
  ResultSequence.</description>
@@ -13541,14 +15908,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a division with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a division with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="idiv" returncomment="A XSInteger consisting of the result of the mathematical integer
-         division." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         division." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical integer division operator between this XSFloat and the
  supplied ResultSequence.</description>
@@ -13562,13 +15929,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an integer division with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an integer division with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="mod" returncomment="A XSFloat consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="mod" returncomment="A XSFloat consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical modulus operator between this XSFloat and the supplied
  ResultSequence. Due to no numeric type promotion or conversion, the
@@ -13582,13 +15949,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="unary_minus" returncomment="A XSFloat representing the negation of the number stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="unary_minus" returncomment="A XSFloat representing the negation of the number stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Negates the number stored</description>
 					<attribute name="@return">
@@ -13654,7 +16021,7 @@
 					<param name="precision" comment="An integer precision" fulltype="int" type="int" />
 				</params>
 			</method>
-			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
@@ -13662,6 +16029,8 @@
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSGDay" type="XSGDay">
@@ -13715,7 +16084,7 @@
 					<param name="str" comment="The String representation of the day (and optional timezone)" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied day" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied day" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable gDay in the
  supplied ResultSequence</description>
@@ -13731,7 +16100,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the gDay is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the gDay is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13758,7 +16127,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the stored day" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the stored day" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the stored day</description>
 					<attribute name="@return">
@@ -13801,7 +16170,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSGDay to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13818,6 +16187,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonth" type="XSGMonth">
@@ -13871,7 +16241,7 @@
 					<param name="str" comment="The String representation of the month (and optional timezone)" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied month" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied month" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable gMonth in the
  supplied ResultSequence</description>
@@ -13887,7 +16257,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the gMonth is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the gMonth is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13914,7 +16284,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the stored month" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the stored month" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the stored month</description>
 					<attribute name="@return">
@@ -13957,7 +16327,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSGMonth to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -13974,6 +16344,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSGMonthDay" type="XSGMonthDay">
@@ -14029,7 +16400,7 @@
             timezone)" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied month and day" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied month and day" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable gMonthDay in
  the supplied ResultSequence</description>
@@ -14045,7 +16416,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the gMonthDay is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the gMonthDay is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14080,7 +16451,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the stored month and day" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the stored month and day" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the stored month and day</description>
 					<attribute name="@return">
@@ -14123,7 +16494,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSGMonthDay to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14137,6 +16508,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYear" type="XSGYear">
@@ -14190,7 +16562,7 @@
 					<param name="str" comment="The String representation of the year (and optional timezone)" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied year" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied year" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable gYear in the
  supplied ResultSequence</description>
@@ -14206,7 +16578,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the gYear is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the gYear is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14233,7 +16605,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the stored year" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the stored year" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the stored year</description>
 					<attribute name="@return">
@@ -14276,7 +16648,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSGYear to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14290,6 +16662,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSGYearMonth" type="XSGYearMonth">
@@ -14345,7 +16718,7 @@
             timezone)" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied year and month" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied year and month" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable gYearMonth in
  the supplied ResultSequence</description>
@@ -14363,7 +16736,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The ResultSequence from which the gYearMonth is to be
-            extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14398,7 +16771,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the stored year and month" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the stored year and month" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the stored year and month</description>
 					<attribute name="@return">
@@ -14441,7 +16814,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSGYearMonth to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14455,6 +16828,7 @@
 					</attribute>
 				</comment>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSHexBinary" type="XSHexBinary">
@@ -14495,7 +16869,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="The hexBinary stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="The hexBinary stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the base64Binary stored. This method is
  functionally identical to value()</description>
@@ -14513,7 +16887,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence representing hexBinary value" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence representing hexBinary value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the hexBinary value</description>
 					<attribute name="@param">
@@ -14528,7 +16902,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to construct hexBinary value" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to construct hexBinary value" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14551,12 +16925,14 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The representation to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSNCName" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSID" type="XSID">
@@ -14569,14 +16945,15 @@
 			<constructor visibility="public" name="XSID" />
 			<method visibility="public" name="string_type" fulltype="java.lang.String" type="String" />
 			<method visibility="public" name="type_name" fulltype="java.lang.String" type="String" />
-			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<params>
-					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSNCName" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSIDREF" type="XSIDREF">
@@ -14589,14 +16966,15 @@
 			<constructor visibility="public" name="XSIDREF" />
 			<method visibility="public" name="string_type" fulltype="java.lang.String" type="String" />
 			<method visibility="public" name="type_name" fulltype="java.lang.String" type="String" />
-			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<params>
-					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSLong" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt" type="XSInt">
@@ -14634,7 +17012,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;int&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;int&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable &apos;int&apos; in the
  supplied ResultSequence</description>
@@ -14650,12 +17028,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the int is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the int is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSDecimal" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger" type="XSInteger">
@@ -14708,7 +17087,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the integer stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the integer stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the integer stored</description>
 					<attribute name="@return">
@@ -14724,7 +17103,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the integer supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the integer supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable integer in the
  supplied ResultSequence</description>
@@ -14740,7 +17119,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the integer is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the integer is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -14772,7 +17151,7 @@
 				</params>
 			</method>
 			<method visibility="public" name="plus" returncomment="A XSInteger consisting of the result of the mathematical
-         addition." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         addition." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition operator between this XSInteger and the supplied
  ResultSequence.</description>
@@ -14786,14 +17165,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform an addition with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="minus" returncomment="A XSInteger consisting of the result of the mathematical
-         subtraction." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         subtraction." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical subtraction operator between this XSInteger and the supplied
  ResultSequence.</description>
@@ -14807,14 +17186,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a subtraction with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a subtraction with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="times" returncomment="A XSInteger consisting of the result of the mathematical
-         multiplication." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         multiplication." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical multiplication operator between this XSInteger and the
  supplied ResultSequence.</description>
@@ -14828,13 +17207,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a multiplication with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a multiplication with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="mod" returncomment="A XSInteger consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="mod" returncomment="A XSInteger consisting of the result of the mathematical modulus." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical modulus operator between this XSInteger and the supplied
  ResultSequence.</description>
@@ -14847,13 +17226,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence to perform a modulus with" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="unary_minus" returncomment="New XSInteger representing the negation of the integer stored" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="unary_minus" returncomment="New XSInteger representing the negation of the integer stored" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Negates the integer stored</description>
 					<attribute name="@return">
@@ -14872,13 +17251,13 @@
 			<method visibility="public" name="gt" fulltype="boolean" type="boolean">
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType">
+			<method visibility="protected" name="convertArg" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item">
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
 				</params>
@@ -14889,20 +17268,21 @@
 			<method visibility="public" name="lt" fulltype="boolean" type="boolean">
 				<params>
 					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="div" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="div" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<params>
-					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSInteger" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong" type="XSLong">
@@ -14940,7 +17320,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;long&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;long&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable long in the
  supplied ResultSequence</description>
@@ -14956,15 +17336,16 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the long is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the long is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
-	<jelclass superclass="XSString" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSString" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName" type="XSNCName">
+	<jelclass superclass="XSName" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSName" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName" type="XSNCName">
 		<comment>
 			<description>A representation of the NCName datatype</description>
 		</comment>
@@ -15002,7 +17383,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the NCName supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the NCName supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable NCName within
  the supplied ResultSequence</description>
@@ -15018,12 +17399,144 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to extract the NCName" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to extract the NCName" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="protected" name="isConstraintSatisfied" fulltype="boolean" type="boolean">
+				<params>
+					<param name="strValue" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="XSToken" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNMTOKEN" type="XSNMTOKEN">
+		<comment>
+			<description>A representation of the NMTOKEN datatype</description>
+		</comment>
+		<methods>
+			<constructor visibility="public" name="XSNMTOKEN">
+				<comment>
+					<description>Initialises using the supplied String</description>
+					<attribute name="@param">
+						<description>x
+            String to be stored</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="x" comment="String to be stored" fulltype="java.lang.String" type="String" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="XSNMTOKEN">
+				<comment>
+					<description>Initialises to null</description>
+				</comment>
+			</constructor>
+			<method visibility="public" name="string_type" returncomment="&quot;xs:NMTOKEN&quot; which is the datatype&apos;s full pathname" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s full pathname</description>
+					<attribute name="@return">
+						<description>&quot;xs:NMTOKEN&quot; which is the datatype&apos;s full pathname</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="type_name" returncomment="&quot;NMTOKEN&quot; which is the datatype&apos;s name" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s name</description>
+					<attribute name="@return">
+						<description>&quot;NMTOKEN&quot; which is the datatype&apos;s name</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the NMTOKEN supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<description>Creates a new ResultSequence consisting of the extractable NMTOKEN within
+ the supplied ResultSequence</description>
+					<attribute name="@param">
+						<description>arg
+            The ResultSequence from which to extract the NMTOKEN</description>
+					</attribute>
+					<attribute name="@return">
+						<description>New ResultSequence consisting of the NMTOKEN supplied</description>
+					</attribute>
+					<attribute name="@throws">
+						<description>DynamicError</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="arg" comment="The ResultSequence from which to extract the NMTOKEN" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+				<exceptions>
+					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
+				</exceptions>
+			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="XSToken" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSName" type="XSName">
+		<comment>
+			<description>A representation of the Name datatype</description>
+		</comment>
+		<methods>
+			<constructor visibility="public" name="XSName">
+				<comment>
+					<description>Initialises using the supplied String</description>
+					<attribute name="@param">
+						<description>x
+            String to be stored</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="x" comment="String to be stored" fulltype="java.lang.String" type="String" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="XSName">
+				<comment>
+					<description>Initialises to null</description>
+				</comment>
+			</constructor>
+			<method visibility="public" name="string_type" returncomment="&quot;xs:Name&quot; which is the datatype&apos;s full pathname" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s full pathname</description>
+					<attribute name="@return">
+						<description>&quot;xs:Name&quot; which is the datatype&apos;s full pathname</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="type_name" returncomment="&quot;Name&quot; which is the datatype&apos;s name" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s name</description>
+					<attribute name="@return">
+						<description>&quot;Name&quot; which is the datatype&apos;s name</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the Name supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<description>Creates a new ResultSequence consisting of the extractable Name within
+ the supplied ResultSequence</description>
+					<attribute name="@param">
+						<description>arg
+            The ResultSequence from which to extract the Name</description>
+					</attribute>
+					<attribute name="@return">
+						<description>New ResultSequence consisting of the Name supplied</description>
+					</attribute>
+					<attribute name="@throws">
+						<description>DynamicError</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="arg" comment="The ResultSequence from which to extract the Name" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+				<exceptions>
+					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
+				</exceptions>
+			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSNonPositiveInteger" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger" type="XSNegativeInteger">
@@ -15061,7 +17574,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;negativeInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;negativeInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable negativeInteger
  in the supplied ResultSequence</description>
@@ -15077,12 +17590,13 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the negativeInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the negativeInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSInteger" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger" type="XSNonNegativeInteger">
@@ -15120,7 +17634,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;nonNegativeInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;nonNegativeInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable nonNegativeInteger
  in the supplied ResultSequence</description>
@@ -15136,12 +17650,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the nonNegativeInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the nonNegativeInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSInteger" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger" type="XSNonPositiveInteger">
@@ -15179,7 +17695,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;nonPositiveInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;nonPositiveInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable nonPositiveInteger
  in the supplied ResultSequence</description>
@@ -15195,28 +17711,100 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the nonPositiveInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the nonPositiveInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="XSString" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSString" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString" type="XSNormalizedString">
+		<comment>
+			<description>A representation of the xs:normalizedString datatype</description>
+		</comment>
+		<methods>
+			<constructor visibility="public" name="XSNormalizedString">
+				<comment>
+					<description>Initialises using the supplied String</description>
+					<attribute name="@param">
+						<description>x
+            The String to initialise to</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="x" comment="The String to initialise to" fulltype="java.lang.String" type="String" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="XSNormalizedString">
+				<comment>
+					<description>Initialises to null</description>
+				</comment>
+			</constructor>
+			<method visibility="public" name="string_type" returncomment="&quot;xs:normalizedString&quot; which is the datatype&apos;s full pathname" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s full pathname</description>
+					<attribute name="@return">
+						<description>&quot;xs:normalizedString&quot; which is the datatype&apos;s full pathname</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="type_name" returncomment="&quot;normalizedString&quot; which is the datatype&apos;s name" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s name</description>
+					<attribute name="@return">
+						<description>&quot;normalizedString&quot; which is the datatype&apos;s name</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied String" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<description>Creates a new ResultSequence consisting of the extractable String in the
+ supplied ResultSequence</description>
+					<attribute name="@param">
+						<description>arg
+            The ResultSequence from which to extract the String</description>
+					</attribute>
+					<attribute name="@return">
+						<description>New ResultSequence consisting of the supplied String</description>
+					</attribute>
+					<attribute name="@throws">
+						<description>DynamicError</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="arg" comment="The ResultSequence from which to extract the String" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+				<exceptions>
+					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
+				</exceptions>
+			</method>
+			<method visibility="protected" name="isSatisfiesConstraints" fulltype="boolean" type="boolean">
+				<params>
+					<param name="srcString" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation" type="XSNotation">
 		<methods>
 			<constructor visibility="public" name="XSNotation" />
 			<method visibility="public" name="string_type" fulltype="java.lang.String" type="String" />
-			<method visibility="public" name="string_value" fulltype="java.lang.String" type="String" />
-			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="getStringValue" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<params>
-					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="type_name" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSNonNegativeInteger" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger" type="XSPositiveInteger">
@@ -15254,7 +17842,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;positiveInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;positiveInteger&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable positiveInteger
  in the supplied ResultSequence</description>
@@ -15270,12 +17858,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the positiveInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the positiveInteger is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSInt" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSInt" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort" type="XSShort">
@@ -15313,7 +17903,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;short&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;short&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable &apos;short&apos; in the
  supplied ResultSequence</description>
@@ -15329,12 +17919,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the short is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the short is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSString" type="XSString">
@@ -15375,7 +17967,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="The String stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="The String stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the string stored. This method is
  functionally identical to value()</description>
@@ -15393,7 +17985,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied String" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied String" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable String in the
  supplied ResultSequence</description>
@@ -15409,7 +18001,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to extract the String" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to extract the String" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -15434,7 +18026,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The representation to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -15459,7 +18051,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The representation to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -15484,12 +18076,14 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The representation to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CalendarType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime" type="XSTime">
@@ -15559,7 +18153,7 @@
 					<param name="str" comment="String represented time and timezone to be stored" fulltype="java.lang.String" type="String" />
 				</params>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied time" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied time" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable time from the
  supplied ResultSequence</description>
@@ -15575,7 +18169,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to extract the time" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to extract the time" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -15613,7 +18207,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the time stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the time stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the time stored</description>
 					<attribute name="@return">
@@ -15672,7 +18266,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSTime to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -15693,7 +18287,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSTime to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -15717,13 +18311,13 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The XSTime to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="minus" returncomment="A ResultSequence representing the result of the subtraction" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="minus" returncomment="A ResultSequence representing the result of the subtraction" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical subtraction between this time stored and the supplied
  representation. This supplied representation must be of either type
@@ -15741,13 +18335,13 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The representation to subtract (either XSTim or
-            XDTDayTimeDuration)" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            XDTDayTimeDuration)" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
-			<method visibility="public" name="plus" returncomment="A XSTime representing the result of this addition." fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="plus" returncomment="A XSTime representing the result of this addition." fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition between this time stored and the supplied time
  duration.</description>
@@ -15765,12 +18359,82 @@
 				</comment>
 				<params>
 					<param name="arg" comment="A XDTDayTimeDuration representation of the duration of time to
-            add" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+            add" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="XSNormalizedString" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken" type="XSToken">
+		<comment>
+			<description>A representation of the xs:token datatype</description>
+		</comment>
+		<methods>
+			<constructor visibility="public" name="XSToken">
+				<comment>
+					<description>Initialises using the supplied String</description>
+					<attribute name="@param">
+						<description>x
+            The String to initialise to</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="x" comment="The String to initialise to" fulltype="java.lang.String" type="String" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="XSToken">
+				<comment>
+					<description>Initialises to null</description>
+				</comment>
+			</constructor>
+			<method visibility="public" name="string_type" returncomment="&quot;xs:token&quot; which is the datatype&apos;s full pathname" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s full pathname</description>
+					<attribute name="@return">
+						<description>&quot;xs:token&quot; which is the datatype&apos;s full pathname</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="type_name" returncomment="&quot;token&quot; which is the datatype&apos;s name" fulltype="java.lang.String" type="String">
+				<comment>
+					<description>Retrieves the datatype&apos;s name</description>
+					<attribute name="@return">
+						<description>&quot;token&quot; which is the datatype&apos;s name</description>
+					</attribute>
+				</comment>
+			</method>
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the supplied String" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
+				<comment>
+					<description>Creates a new ResultSequence consisting of the extractable String in the
+ supplied ResultSequence</description>
+					<attribute name="@param">
+						<description>arg
+            The ResultSequence from which to extract the String</description>
+					</attribute>
+					<attribute name="@return">
+						<description>New ResultSequence consisting of the supplied String</description>
+					</attribute>
+					<attribute name="@throws">
+						<description>DynamicError</description>
+					</attribute>
+				</comment>
+				<params>
+					<param name="arg" comment="The ResultSequence from which to extract the String" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+				<exceptions>
+					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
+				</exceptions>
+			</method>
+			<method visibility="protected" name="isSatisfiesConstraints" fulltype="boolean" type="boolean">
+				<params>
+					<param name="srcString" fulltype="java.lang.String" type="String" />
+				</params>
+			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSUnsignedShort" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte" type="XSUnsignedByte">
@@ -15808,7 +18472,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedByte&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedByte&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable unsignedByte
  in the supplied ResultSequence</description>
@@ -15824,12 +18488,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the unsignedByte is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the unsignedByte is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSUnsignedLong" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt" type="XSUnsignedInt">
@@ -15867,7 +18533,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedInt&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedInt&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable unsignedInt
  in the supplied ResultSequence</description>
@@ -15883,12 +18549,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the unsignedInt is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the unsignedInt is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSNonNegativeInteger" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong" type="XSUnsignedLong">
@@ -15926,7 +18594,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedLong&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedLong&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable unsignedLong
  in the supplied ResultSequence</description>
@@ -15942,12 +18610,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the unsignedLong is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the unsignedLong is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSUnsignedInt" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedShort" type="XSUnsignedShort">
@@ -15985,7 +18655,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedShort&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the &apos;unsignedShort&apos; supplied" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable unsignedShort
  in the supplied ResultSequence</description>
@@ -16001,12 +18671,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which the unsignedShort is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which the unsignedShort is to be extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="CtrType" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic" type="XSUntypedAtomic">
@@ -16038,7 +18710,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the value of this untyped atomic node" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the value of this untyped atomic node" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the value of this untyped atomic
  node</description>
@@ -16047,15 +18719,17 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<params>
-					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="type_name" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getNativeValue" fulltype="java.lang.Object" type="Object" />
 		</methods>
 	</jelclass>
 	<jelclass superclass="XSDuration" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration" type="XSYearMonthDuration">
@@ -16131,7 +18805,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the time duration extracted" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+			<method visibility="public" name="constructor" returncomment="New ResultSequence consisting of the time duration extracted" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Creates a new ResultSequence consisting of the extractable time duration
  from the supplied ResultSequence</description>
@@ -16147,7 +18821,7 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The ResultSequence from which to extract" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The ResultSequence from which to extract" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -16164,7 +18838,7 @@
 					</attribute>
 				</comment>
 			</method>
-			<method visibility="public" name="string_value" returncomment="String representation of the duration of time stored" fulltype="java.lang.String" type="String">
+			<method visibility="public" name="getStringValue" returncomment="String representation of the duration of time stored" fulltype="java.lang.String" type="String">
 				<comment>
 					<description>Retrieves a String representation of the duration of time stored</description>
 					<attribute name="@return">
@@ -16204,7 +18878,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The duration of time to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="dynamicContext" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -16228,7 +18902,7 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The duration of time to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -16252,14 +18926,14 @@
 				</comment>
 				<params>
 					<param name="arg" comment="The duration of time to compare with" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
-					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicContext" type="DynamicContext" />
+					<param name="context" fulltype="org.eclipse.wst.xml.xpath2.api.DynamicContext" type="DynamicContext" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="plus" returncomment="New XSYearMonthDuration representing the resulting duration
-         after the addition" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         after the addition" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical addition between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</description>
@@ -16276,14 +18950,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to add" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to add" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="minus" returncomment="New XSYearMonthDuration representing the resulting duration
-         after the subtraction" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         after the subtraction" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical subtraction between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</description>
@@ -16300,14 +18974,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to subtract" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to subtract" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="times" returncomment="New XSYearMonthDuration representing the resulting duration
-         after the multiplication" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         after the multiplication" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical multiplication between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</description>
@@ -16324,14 +18998,14 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to multiply by" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to multiply by" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
 			<method visibility="public" name="div" returncomment="New XSYearMonthDuration representing the resulting duration
-         after the division" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence">
+         after the division" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence">
 				<comment>
 					<description>Mathematical division between this duration stored and the supplied
  duration of time (of type XSYearMonthDuration)</description>
@@ -16348,14 +19022,221 @@
 					</attribute>
 				</comment>
 				<params>
-					<param name="arg" comment="The duration of time to divide by" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="arg" comment="The duration of time to divide by" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception comment="" fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
 				</exceptions>
 			</method>
+			<method visibility="public" name="getTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
 		</methods>
 	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition" type="AtomicTypeDefinition">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+		</implements>
+		<methods>
+			<method visibility="public" name="construct" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence" type="SingleItemSequence">
+				<params>
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
+			<method visibility="public" name="constructNative" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence" type="SingleItemSequence">
+				<params>
+					<param name="rs" fulltype="java.lang.Object" type="Object" />
+				</params>
+			</method>
+		</methods>
+	</jelclass>
+	<jelclass superclass="BuiltinTypeDefinition" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition">
+		<methods>
+			<constructor visibility="public" name="BuiltinAtomicTypeDefinition">
+				<params>
+					<param name="name" fulltype="java.lang.String" type="String" />
+					<param name="implementationClass" fulltype="java.lang.Class" type="Class" />
+					<param name="nativeType" fulltype="java.lang.Class" type="Class" />
+					<param name="baseType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+				</params>
+			</constructor>
+			<method visibility="public" name="isAbstract" fulltype="boolean" type="boolean" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="BuiltinTypeDefinition" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin" superclassfulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition" type="BuiltinListTypeDefinition">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition" type="SimpleTypeDefinition" />
+		</implements>
+		<methods>
+			<constructor visibility="public" name="BuiltinListTypeDefinition">
+				<params>
+					<param name="name" fulltype="javax.xml.namespace.QName" type="QName" />
+					<param name="baseType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+					<param name="itemType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="BuiltinListTypeDefinition">
+				<params>
+					<param name="name" fulltype="java.lang.String" type="String" />
+					<param name="baseType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+					<param name="itemType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+				</params>
+			</constructor>
+			<method visibility="public" name="isAbstract" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="getVariety" fulltype="short" type="short" />
+			<method visibility="public" name="getPrimitiveType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition" type="SimpleTypeDefinition" />
+			<method visibility="public" name="getBuiltInKind" fulltype="short" type="short" />
+			<method visibility="public" name="getItemType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="getMemberTypes" fulltype="java.util.List" type="List" />
+			<method visibility="public" name="getOrdered" fulltype="short" type="short" />
+			<method visibility="public" name="getFinite" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="getBounded" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="getNumeric" fulltype="boolean" type="boolean" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition" type="AtomicTypeDefinition" />
+		</implements>
+		<fields>
+			<field final="true" static="true" const="http://www.w3.org/2001/XMLSchema" visibility="public" name="XS_NS" constexpr="&quot;http://www.w3.org/2001/XMLSchema&quot;" fulltype="java.lang.String" type="String" />
+		</fields>
+		<methods>
+			<constructor visibility="public" name="BuiltinTypeDefinition">
+				<params>
+					<param name="name" fulltype="javax.xml.namespace.QName" type="QName" />
+					<param name="baseType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="BuiltinTypeDefinition">
+				<params>
+					<param name="name" fulltype="java.lang.String" type="String" />
+					<param name="baseType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="BuiltinTypeDefinition">
+				<params>
+					<param name="name" fulltype="javax.xml.namespace.QName" type="QName" />
+					<param name="implementationClass" fulltype="java.lang.Class" type="Class" />
+					<param name="nativeType" fulltype="java.lang.Class" type="Class" />
+					<param name="baseType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+				</params>
+			</constructor>
+			<constructor visibility="public" name="BuiltinTypeDefinition">
+				<params>
+					<param name="name" fulltype="java.lang.String" type="String" />
+					<param name="implementationClass" fulltype="java.lang.Class" type="Class" />
+					<param name="nativeType" fulltype="java.lang.Class" type="Class" />
+					<param name="baseType" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+				</params>
+			</constructor>
+			<method visibility="public" name="isAbstract" fulltype="boolean" type="boolean" />
+			<method visibility="public" name="getNamespace" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getName" fulltype="java.lang.String" type="String" />
+			<method visibility="public" name="getBaseType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+			<method visibility="public" name="derivedFromType" fulltype="boolean" type="boolean">
+				<params>
+					<param name="ancestorType" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition" type="TypeDefinition" />
+					<param name="derivationMethod" fulltype="short" type="short" />
+				</params>
+			</method>
+			<method visibility="public" name="derivedFrom" fulltype="boolean" type="boolean">
+				<params>
+					<param name="namespace" fulltype="java.lang.String" type="String" />
+					<param name="name" fulltype="java.lang.String" type="String" />
+					<param name="derivationMethod" fulltype="short" type="short" />
+				</params>
+			</method>
+			<method visibility="public" name="getSimpleTypes" fulltype="java.util.List" type="List">
+				<params>
+					<param name="attr" fulltype="org.w3c.dom.Attr" type="Attr" />
+				</params>
+			</method>
+			<method visibility="public" name="getSimpleTypes" fulltype="java.util.List" type="List">
+				<params>
+					<param name="attr" fulltype="org.w3c.dom.Element" type="Element" />
+				</params>
+			</method>
+			<method visibility="public" name="construct" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence" type="SingleItemSequence">
+				<params>
+					<param name="rs" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+				</params>
+			</method>
+			<method visibility="public" name="constructNative" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence" type="SingleItemSequence">
+				<params>
+					<param name="obj" fulltype="java.lang.Object" type="Object" />
+				</params>
+			</method>
+			<method visibility="public" name="getNativeType" fulltype="java.lang.Class" type="Class" />
+		</methods>
+	</jelclass>
+	<jelclass superclass="Object" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin" superclassfulltype="java.lang.Object" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary" type="BuiltinTypeLibrary">
+		<comment>
+			<description>This type captures all of the built-in XPath 2.0 types, as defined in F&amp;O specification.
+ http://www.w3.org/TR/xquery-operators/#datatypes</description>
+		</comment>
+		<fields>
+			<field final="true" static="true" visibility="public" name="XS_ANYTYPE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_UNTYPED" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_ANYSIMPLETYPE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition" type="BuiltinTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_ANYATOMICTYPE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_UNTYPEDATOMIC" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_DATETIME" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_DATE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_TIME" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_DURATION" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_YEARMONTHDURATION" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_DAYTIMEDURATION" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_FLOAT" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_DOUBLE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_DECIMAL" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_INTEGER" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NONPOSITIVEINTEGER" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NEGATIVEINTEGER" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_LONG" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_INT" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_SHORT" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_BYTE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NONNEGATIVEINTEGER" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_UNSIGNEDLONG" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_UNSIGNEDINT" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_UNSIGNEDSHORT" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_UNSIGNEDBYTE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_POSITIVEINTEGER" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_GYEARMONTH" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_GYEAR" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_GMONTHDAY" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_GDAY" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_GMONTH" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_STRING" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NORMALIZEDSTRING" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_TOKEN" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_LANGUAGE" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NMTOKEN" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NAME" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NCNAME" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_ID" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_IDREF" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_ENTITY" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_BOOLEAN" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_BASE64BINARY" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_HEXBINARY" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_ANYURI" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_QNAME" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NOTATION" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition" type="BuiltinAtomicTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_IDREFS" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition" type="BuiltinListTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_NMTOKENS" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition" type="BuiltinListTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="XS_ENTITIES" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition" type="BuiltinListTypeDefinition" />
+			<field final="true" static="true" visibility="public" name="BUILTIN_TYPES" fulltype="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel" type="TypeModel" />
+		</fields>
+		<methods>
+			<constructor visibility="public" name="BuiltinTypeLibrary" />
+		</methods>
+	</jelclass>
+	<jelclass abstract="true" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin" interface="true" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence" type="SingleItemSequence">
+		<implements>
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
+			<interface fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
+		</implements>
+	</jelclass>
 	<jelclass superclass="ConstructorFL" visibility="public" package="org.eclipse.wst.xml.xpath2.processor.internal.types.userdefined" superclassfulltype="ConstructorFL" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.userdefined.UserDefinedCtrLibrary" type="UserDefinedCtrLibrary">
 		<methods>
 			<constructor visibility="public" name="UserDefinedCtrLibrary">
@@ -16705,7 +19586,7 @@
 			</method>
 			<method visibility="public" name="considerSequence" fulltype="void" type="void">
 				<params>
-					<param name="sequenceToConsider" fulltype="org.eclipse.wst.xml.xpath2.processor.ResultSequence" type="ResultSequence" />
+					<param name="sequenceToConsider" fulltype="org.eclipse.wst.xml.xpath2.api.ResultSequence" type="ResultSequence" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
@@ -16719,12 +19600,12 @@
 			</method>
 			<method visibility="public" name="atomize" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType" type="AnyAtomicType">
 				<params>
-					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
+					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
 				</params>
 			</method>
 			<method visibility="public" name="considerValue" fulltype="void" type="void">
 				<params>
-					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType" type="AnyType" />
+					<param name="at" fulltype="org.eclipse.wst.xml.xpath2.api.Item" type="Item" />
 				</params>
 				<exceptions>
 					<exception fulltype="org.eclipse.wst.xml.xpath2.processor.DynamicError" type="DynamicError" />
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/pom.xml b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/pom.xml
index 3b5b30b..1d8770b 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/pom.xml
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/pom.xml
@@ -11,7 +11,7 @@
 	</parent>
 
 	<artifactId>org.eclipse.wst.xml.xpath2.sdk.doc</artifactId>
-	<version>1.0.0-SNAPSHOT</version>
+	<version>2.0.0-SNAPSHOT</version>
 	<packaging>eclipse-plugin</packaging>
 	<name>PsychoPath XPath 2.0 Processor: SDK Documentation</name>
 </project>
diff --git a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/toc.xml b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/toc.xml
index 7ee5f00..be123ab 100644
--- a/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/toc.xml
+++ b/docs/org.eclipse.wst.xml.xpath2.processor.sdk.doc/toc.xml
@@ -1,6 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<toc label="XPath 2.0 - PsychoPath Processor SDK Documentation">
+<?xml version="1.0" encoding="UTF-8"?><toc label="XSL Tools SDK Documentation">
    <topic label="Reference">
+      <topic label="org.eclipse.wst.xml.xpath2.api">
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.AtomicItemType.html" label="org.eclipse.wst.xml.xpath2.api.AtomicItemType"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.CollationProvider.html" label="org.eclipse.wst.xml.xpath2.api.CollationProvider"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.DynamicContext.html" label="org.eclipse.wst.xml.xpath2.api.DynamicContext"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.EvaluationContext.html" label="org.eclipse.wst.xml.xpath2.api.EvaluationContext"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.Function.html" label="org.eclipse.wst.xml.xpath2.api.Function"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.FunctionLibrary.html" label="org.eclipse.wst.xml.xpath2.api.FunctionLibrary"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.Item.html" label="org.eclipse.wst.xml.xpath2.api.Item"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.Match.html" label="org.eclipse.wst.xml.xpath2.api.Match"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.html" label="org.eclipse.wst.xml.xpath2.api.ResultBuffer"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence.html" label="org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence.html" label="org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence.html" label="org.eclipse.wst.xml.xpath2.api.ResultBuffer.SingleResultSequence"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence.html" label="org.eclipse.wst.xml.xpath2.api.ResultBuffer.ArrayResultSequence"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.ResultSequence.html" label="org.eclipse.wst.xml.xpath2.api.ResultSequence"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.StaticContext.html" label="org.eclipse.wst.xml.xpath2.api.StaticContext"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.StaticVariableResolver.html" label="org.eclipse.wst.xml.xpath2.api.StaticVariableResolver"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Engine.html" label="org.eclipse.wst.xml.xpath2.api.XPath2Engine"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Expression.html" label="org.eclipse.wst.xml.xpath2.api.XPath2Expression"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.XPath2Pattern.html" label="org.eclipse.wst.xml.xpath2.api.XPath2Pattern"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.XPath2PatternSet.html" label="org.eclipse.wst.xml.xpath2.api.XPath2PatternSet"/>
+      </topic>
+      <topic label="org.eclipse.wst.xml.xpath2.api.typesystem">
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition.html" label="org.eclipse.wst.xml.xpath2.api.typesystem.ComplexTypeDefinition"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.ItemType.html" label="org.eclipse.wst.xml.xpath2.api.typesystem.ItemType"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType.html" label="org.eclipse.wst.xml.xpath2.api.typesystem.NodeItemType"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.PrimitiveType.html" label="org.eclipse.wst.xml.xpath2.api.typesystem.PrimitiveType"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition.html" label="org.eclipse.wst.xml.xpath2.api.typesystem.SimpleTypeDefinition"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition.html" label="org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel.html" label="org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel"/>
+      </topic>
       <topic label="org.eclipse.wst.xml.xpath2.processor">
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.CollationProvider.html" label="org.eclipse.wst.xml.xpath2.processor.CollationProvider"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DOMBuilder.html" label="org.eclipse.wst.xml.xpath2.processor.DOMBuilder"/>
@@ -8,14 +38,16 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DOMLoaderException.html" label="org.eclipse.wst.xml.xpath2.processor.DOMLoaderException"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator"/>
-         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.DummyError.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.DummyError"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.Pair.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.Pair"/>
-         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.DummyError.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.DummyError"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.Pair.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.Pair"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope.html" label="org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.VariableScope"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicContext.html" label="org.eclipse.wst.xml.xpath2.processor.DynamicContext"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.DynamicError.html" label="org.eclipse.wst.xml.xpath2.processor.DynamicError"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.Engine.html" label="org.eclipse.wst.xml.xpath2.processor.Engine"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.Evaluator.html" label="org.eclipse.wst.xml.xpath2.processor.Evaluator"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.JFlexCupParser.html" label="org.eclipse.wst.xml.xpath2.processor.JFlexCupParser"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.PsychoPathTypeHelper.html" label="org.eclipse.wst.xml.xpath2.processor.PsychoPathTypeHelper"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.ResultSequence.html" label="org.eclipse.wst.xml.xpath2.processor.ResultSequence"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory.html" label="org.eclipse.wst.xml.xpath2.processor.ResultSequenceFactory"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.StaticChecker.html" label="org.eclipse.wst.xml.xpath2.processor.StaticChecker"/>
@@ -23,7 +55,9 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.StaticError.html" label="org.eclipse.wst.xml.xpath2.processor.StaticError"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.html" label="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.DummyError.html" label="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.DummyError"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope.html" label="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.DummyError.html" label="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.DummyError"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope.html" label="org.eclipse.wst.xml.xpath2.processor.StaticNameResolver.VariableScope"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.XPathException.html" label="org.eclipse.wst.xml.xpath2.processor.XPathException"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.XPathParser.html" label="org.eclipse.wst.xml.xpath2.processor.XPathParser"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.XPathParserException.html" label="org.eclipse.wst.xml.xpath2.processor.XPathParserException"/>
@@ -48,6 +82,7 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext.html" label="org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis.html" label="org.eclipse.wst.xml.xpath2.processor.internal.DescendantAxis"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis.html" label="org.eclipse.wst.xml.xpath2.processor.internal.DescendantOrSelfAxis"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.DynamicContextAdapter.html" label="org.eclipse.wst.xml.xpath2.processor.internal.DynamicContextAdapter"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.Focus.html" label="org.eclipse.wst.xml.xpath2.processor.internal.Focus"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingAxis.html" label="org.eclipse.wst.xml.xpath2.processor.internal.FollowingAxis"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis.html" label="org.eclipse.wst.xml.xpath2.processor.internal.FollowingSiblingAxis"/>
@@ -62,6 +97,7 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis.html" label="org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.SeqType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.SeqType"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticAttrNameError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.StaticAttrNameError"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter.html" label="org.eclipse.wst.xml.xpath2.processor.internal.StaticContextAdapter"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticElemNameError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.StaticElemNameError"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticFunctNameError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.StaticFunctNameError"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticNameError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.StaticNameError"/>
@@ -69,9 +105,9 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticTypeNameError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.StaticTypeNameError"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.StaticVarNameError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.StaticVarNameError"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.TypeError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.TypeError"/>
-         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPath2Plugin.html" label="org.eclipse.wst.xml.xpath2.processor.internal.XPath2Plugin"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPathCup.html" label="org.eclipse.wst.xml.xpath2.processor.internal.XPathCup"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.CUP$XPathCup$actions.html" label="org.eclipse.wst.xml.xpath2.processor.internal.CUP$XPathCup$actions"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPathCupRestricted.html" label="org.eclipse.wst.xml.xpath2.processor.internal.XPathCupRestricted"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPathError.html" label="org.eclipse.wst.xml.xpath2.processor.internal.XPathError"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XPathFlex.html" label="org.eclipse.wst.xml.xpath2.processor.internal.XPathFlex"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.XpathSym.html" label="org.eclipse.wst.xml.xpath2.processor.internal.XpathSym"/>
@@ -151,10 +187,13 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.DocType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.DocType"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeItemTypeImpl.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeItemTypeImpl"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.PIType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.PIType"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.QName.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.QName"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SchemaTypeValueFactory.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.SchemaTypeValueFactory"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.SimpleAtomicItemTypeImpl"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.TextType.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.TextType"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XPathDecimalFormat.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XPathDecimalFormat"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSAnyURI"/>
@@ -181,14 +220,18 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSInteger"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSLong"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNMTOKEN.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNMTOKEN"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSName.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSName"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNegativeInteger"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonNegativeInteger"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNonPositiveInteger"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNormalizedString"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSNotation"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSPositiveInteger"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSShort"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSString.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSString"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSTime"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSToken"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedByte"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedInt"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUnsignedLong"/>
@@ -196,6 +239,14 @@
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSUntypedAtomic"/>
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.XSYearMonthDuration"/>
       </topic>
+      <topic label="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin">
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.AtomicTypeDefinition"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinAtomicTypeDefinition"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinListTypeDefinition"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeDefinition"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.BuiltinTypeLibrary"/>
+         <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.builtin.SingleItemSequence"/>
+      </topic>
       <topic label="org.eclipse.wst.xml.xpath2.processor.internal.types.userdefined">
          <topic href="doc/html/org.eclipse.wst.xml.xpath2.processor.internal.types.userdefined.UserDefinedCtrLibrary.html" label="org.eclipse.wst.xml.xpath2.processor.internal.types.userdefined.UserDefinedCtrLibrary"/>
       </topic>
diff --git a/features/org.eclipse.wst.xml.xpath2.processor.feature/feature.xml b/features/org.eclipse.wst.xml.xpath2.processor.feature/feature.xml
index 4a75c89..0109119 100644
--- a/features/org.eclipse.wst.xml.xpath2.processor.feature/feature.xml
+++ b/features/org.eclipse.wst.xml.xpath2.processor.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml.xpath2.processor.feature"
       label="%featureName"
-      version="1.2.0.qualifier"
+      version="2.0.0.qualifier"
       provider-name="%providerName"
       plugin="org.eclipse.wst.xml.xpath2"
       license-feature="org.eclipse.license"
@@ -42,6 +42,13 @@
          unpack="false"/>
 
    <plugin
+         id="org.eclipse.wst.xml.xpath2.wtptypes"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
          id="org.eclipse.wst.xml.xpath2"
          download-size="0"
          install-size="0"
diff --git a/features/org.eclipse.wst.xml.xpath2.processor.sdk.feature/feature.xml b/features/org.eclipse.wst.xml.xpath2.processor.sdk.feature/feature.xml
index ad9933e..9dbb0b2 100644
--- a/features/org.eclipse.wst.xml.xpath2.processor.sdk.feature/feature.xml
+++ b/features/org.eclipse.wst.xml.xpath2.processor.sdk.feature/feature.xml
@@ -2,11 +2,9 @@
 <feature
       id="org.eclipse.wst.xml.xpath2.processor.sdk.feature"
       label="%featureName"
-      version="1.1.4.qualifier"
+      version="2.0.0.qualifier"
       provider-name="%providerName"
-      plugin="org.eclipse.wst.xml.xpath2"
-      license-feature="org.eclipse.license"
-      license-feature-version="1.0.0.qualifier">
+      plugin="org.eclipse.wst.xml.xpath2">
 
    <description>
       %description