Index: /CKEditor/branches/prototype/_source/core/tools.js
===================================================================
--- /CKEditor/branches/prototype/_source/core/tools.js	(revision 2149)
+++ /CKEditor/branches/prototype/_source/core/tools.js	(revision 2150)
@@ -117,5 +117,5 @@
 	isArray : function( object )
 	{
-		return ( object && object instanceof Array );
+		return ( !!object && object instanceof Array );
 	}
 };
Index: /CKEditor/branches/prototype/_source/core/xml.js
===================================================================
--- /CKEditor/branches/prototype/_source/core/xml.js	(revision 2149)
+++ /CKEditor/branches/prototype/_source/core/xml.js	(revision 2150)
@@ -108,5 +108,5 @@
 	 * @param {Object} [contextNode] The XML DOM node to be used as the context
 	 *		for the XPath query. The document root is used by default.
-	 * @returns {Array} An array containing all matched nodes. The array will
+	 * @returns {ArrayLike} An array containing all matched nodes. The array will
 	 *		be empty if the query has no results.
 	 * @example
Index: /CKEditor/branches/prototype/_source/tests/core/env.html
===================================================================
--- /CKEditor/branches/prototype/_source/tests/core/env.html	(revision 2149)
+++ /CKEditor/branches/prototype/_source/tests/core/env.html	(revision 2150)
@@ -29,4 +29,9 @@
 				assert.isFalse( CKEDITOR.env.ie );
 		},
+		
+		test_isCompatible : function()
+		{
+			assert.isTrue( CKEDITOR.env.isCompatible );
+		},
 
 		name : document.title
Index: /CKEditor/branches/prototype/_source/tests/core/tools.html
===================================================================
--- /CKEditor/branches/prototype/_source/tests/core/tools.html	(revision 2149)
+++ /CKEditor/branches/prototype/_source/tests/core/tools.html	(revision 2150)
@@ -62,4 +62,24 @@
 			assert.areSame( fakeArray	, target.prop7, 'prop7 doesn\'t match' );
 		},
+		
+		test_isArray1 : function()
+		{
+			assert.isTrue( CKEDITOR.tools.isArray( [] ) );
+		},
+
+		test_isArray2 : function()
+		{
+			assert.isFalse( CKEDITOR.tools.isArray( { length:1 } ) );
+		},
+
+		test_isArray3 : function()
+		{
+			assert.isFalse( CKEDITOR.tools.isArray( null ) );
+		},
+
+		test_isArray4 : function()
+		{
+			assert.isFalse( CKEDITOR.tools.isArray( window.x ) );
+		},
 
 		name : document.title
Index: /CKEditor/branches/prototype/_source/tests/core/xml.html
===================================================================
--- /CKEditor/branches/prototype/_source/tests/core/xml.html	(revision 2150)
+++ /CKEditor/branches/prototype/_source/tests/core/xml.html	(revision 2150)
@@ -0,0 +1,142 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>CKEDITOR.xml</title>
+	<link rel="stylesheet" type="text/css" href="../test.css" />
+	<script type="text/javascript" src="../../../ckeditor.js"></script>
+	<script type="text/javascript" src="../test.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+CKEDITOR.test.addTestCase( (function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	return {
+		test_baseXml : function()
+		{
+			var xml = new CKEDITOR.xml( '<data />' );
+			assert.isObject( xml.baseXml );
+		},
+		
+		test_selectSingleNode1a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item /></data>' );
+			var node = xml.selectSingleNode( 'data/item' );
+			assert.areEqual( 'item', node.nodeName );
+		},
+
+		test_selectSingleNode1b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item /></data>' );
+			var node = xml.selectSingleNode( 'item' );
+			assert.isNull( node );
+		},
+
+		test_selectSingleNode2a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item><subitem/></item></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var node = xml.selectSingleNode( 'item/subitem', contextNode );
+			assert.areEqual( 'subitem', node.nodeName );
+		},
+
+		test_selectSingleNode2b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item><subitem/></item></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var node = xml.selectSingleNode( 'subitem', contextNode );
+			assert.isNull( node );
+		},
+
+		test_selectSingleNode3 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/></data>' );
+			var node = xml.selectSingleNode( '//item[@id="x2"]' );
+			assert.areEqual( 'item', node.nodeName );
+			assert.areEqual( 'x2', node.getAttribute( 'id' ) );
+		},
+
+		test_selectSingleNode4 : function()
+		{
+			// For may results, the first one must be returned.
+
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/></data>' );
+			var node = xml.selectSingleNode( '//item' );
+			assert.areEqual( 'item', node.nodeName );
+			assert.areEqual( 'x1', node.getAttribute( 'id' ) );
+		},
+
+		test_selectNodes1 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item /></data>' );
+			var nodes = xml.selectNodes( 'data/item' );
+			assert.areEqual( 1, nodes.length );
+			assert.areEqual( 'item', nodes[0].nodeName );
+		},
+
+		test_selectNodes2a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var nodes = xml.selectNodes( '//item' );
+			assert.areEqual( 3, nodes.length );
+			assert.areEqual( 'x1', nodes[0].getAttribute( 'id' ) );
+			assert.areEqual( 'x2', nodes[1].getAttribute( 'id' ) );
+			assert.areEqual( 'x3', nodes[2].getAttribute( 'id' ) );
+		},
+
+		test_selectNodes2b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var nodes = xml.selectNodes( '//itemX' );
+			assert.areEqual( 0, nodes.length );
+		},
+
+		test_selectNodes3a : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var nodes = xml.selectNodes( 'item', contextNode );
+			assert.areEqual( 3, nodes.length );
+			assert.areEqual( 'x1', nodes[0].getAttribute( 'id' ) );
+			assert.areEqual( 'x2', nodes[1].getAttribute( 'id' ) );
+			assert.areEqual( 'x3', nodes[2].getAttribute( 'id' ) );
+		},
+
+		test_selectNodes3b : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/><item id="x2"/><item id="x3"/></data>' );
+			var contextNode = xml.selectSingleNode( 'data' );
+			var nodes = xml.selectNodes( 'itemX', contextNode );
+			assert.areEqual( 0, nodes.length );
+		},
+
+		test_getOuterXml1 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item/></data>' );
+			assert.areEqual( '<data><item/></data>', xml.getOuterXml( 'data' ) );
+		},
+
+		test_getOuterXml2 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/></data>' );
+			assert.areEqual( '<item id="x1"/>', xml.getOuterXml( '//item' ) );
+		},
+
+		test_getOuterXml3 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"/></data>' );
+			assert.isNull( xml.getOuterXml( '//itemX' ) );
+		},
+
+		name : document.title
+	};
+})() );
+
+	//]]>
+	</script>
+</head>
+<body>
+</body>
+</html>
Index: /CKEditor/branches/prototype/_source/tests/testall.html
===================================================================
--- /CKEditor/branches/prototype/_source/tests/testall.html	(revision 2149)
+++ /CKEditor/branches/prototype/_source/tests/testall.html	(revision 2150)
@@ -16,5 +16,6 @@
 	'core/event',
 	'core/scriptloader',
-	'core/tools'
+	'core/tools',
+	'core/xml'
 ];
 
