Index: CKEditor/trunk/_source/core/ajax.js
===================================================================
--- CKEditor/trunk/_source/core/ajax.js	(revision 6603)
+++ 	(revision )
@@ -1,142 +1,0 @@
-﻿/*
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
-
-/**
- * @fileOverview Defines the {@link CKEDITOR.ajax} object, which holds ajax methods for
- *		data loading.
- */
-
-/**
- * @namespace Ajax methods for data loading.
- * @example
- */
-CKEDITOR.ajax = (function()
-{
-	var createXMLHttpRequest = function()
-	{
-		// In IE, using the native XMLHttpRequest for local files may throw
-		// "Access is Denied" errors.
-		if ( !CKEDITOR.env.ie || location.protocol != 'file:' )
-			try { return new XMLHttpRequest(); } catch(e) {}
-
-		try { return new ActiveXObject( 'Msxml2.XMLHTTP' ); } catch (e) {}
-		try { return new ActiveXObject( 'Microsoft.XMLHTTP' ); } catch (e) {}
-
-		return null;
-	};
-
-	var checkStatus = function( xhr )
-	{
-		// HTTP Status Codes:
-		//	 2xx : Success
-		//	 304 : Not Modified
-		//	   0 : Returned when running locally (file://)
-		//	1223 : IE may change 204 to 1223 (see http://dev.jquery.com/ticket/1450)
-
-		return ( xhr.readyState == 4 &&
-				(	( xhr.status >= 200 && xhr.status < 300 ) ||
-					xhr.status == 304 ||
-					xhr.status === 0 ||
-					xhr.status == 1223 ) );
-	};
-
-	var getResponseText = function( xhr )
-	{
-		if ( checkStatus( xhr ) )
-			return xhr.responseText;
-		return null;
-	};
-
-	var getResponseXml = function( xhr )
-	{
-		if ( checkStatus( xhr ) )
-		{
-			var xml = xhr.responseXML;
-			return new CKEDITOR.xml( xml && xml.firstChild ? xml : xhr.responseText );
-		}
-		return null;
-	};
-
-	var load = function( url, callback, getResponseFn )
-	{
-		var async = !!callback;
-
-		var xhr = createXMLHttpRequest();
-
-		if ( !xhr )
-			return null;
-
-		xhr.open( 'GET', url, async );
-
-		if ( async )
-		{
-			// TODO: perform leak checks on this closure.
-			/** @ignore */
-			xhr.onreadystatechange = function()
-			{
-				if ( xhr.readyState == 4 )
-				{
-					callback( getResponseFn( xhr ) );
-					xhr = null;
-				}
-			};
-		}
-
-		xhr.send(null);
-
-		return async ? '' : getResponseFn( xhr );
-	};
-
-	return 	/** @lends CKEDITOR.ajax */ {
-
-		/**
-		 * Loads data from an URL as plain text.
-		 * @param {String} url The URL from which load data.
-		 * @param {Function} [callback] A callback function to be called on
-		 *		data load. If not provided, the data will be loaded
-		 *		asynchronously, passing the data value the function on load.
-		 * @returns {String} The loaded data. For asynchronous requests, an
-		 *		empty string. For invalid requests, null.
-		 * @example
-		 * // Load data synchronously.
-		 * var data = CKEDITOR.ajax.load( 'somedata.txt' );
-		 * alert( data );
-		 * @example
-		 * // Load data asynchronously.
-		 * var data = CKEDITOR.ajax.load( 'somedata.txt', function( data )
-		 *     {
-		 *         alert( data );
-		 *     } );
-		 */
-		load : function( url, callback )
-		{
-			return load( url, callback, getResponseText );
-		},
-
-		/**
-		 * Loads data from an URL as XML.
-		 * @param {String} url The URL from which load data.
-		 * @param {Function} [callback] A callback function to be called on
-		 *		data load. If not provided, the data will be loaded
-		 *		asynchronously, passing the data value the function on load.
-		 * @returns {CKEDITOR.xml} An XML object holding the loaded data. For asynchronous requests, an
-		 *		empty string. For invalid requests, null.
-		 * @example
-		 * // Load XML synchronously.
-		 * var xml = CKEDITOR.ajax.loadXml( 'somedata.xml' );
-		 * alert( xml.getInnerXml( '//' ) );
-		 * @example
-		 * // Load XML asynchronously.
-		 * var data = CKEDITOR.ajax.loadXml( 'somedata.xml', function( xml )
-		 *     {
-		 *         alert( xml.getInnerXml( '//' ) );
-		 *     } );
-		 */
-		loadXml : function( url, callback )
-		{
-			return load( url, callback, getResponseXml );
-		}
-	};
-})();
Index: CKEditor/trunk/_source/core/xml.js
===================================================================
--- CKEditor/trunk/_source/core/xml.js	(revision 6603)
+++ 	(revision )
@@ -1,165 +1,0 @@
-﻿/*
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
-
-/**
- * @fileOverview Defines the {@link CKEDITOR.xml} class, which represents a
- *		loaded XML document.
- */
-
-/**
- * Represents a loaded XML document.
- * @constructor
- * @param {object|string} xmlObjectOrData A native XML (DOM document) object or
- *		a string containing the XML definition to be loaded.
- * @example
- * var xml = <b>new CKEDITOR.xml( '<books><book title="My Book" /></books>' )</b>;
- */
-CKEDITOR.xml = function( xmlObjectOrData )
-{
-	var baseXml = null;
-
-	if ( typeof xmlObjectOrData == 'object' )
-		baseXml = xmlObjectOrData;
-	else
-	{
-		var data = ( xmlObjectOrData || '' ).replace( /&nbsp;/g, '\xA0' );
-		if ( window.DOMParser )
-			baseXml = (new DOMParser()).parseFromString( data, 'text/xml' );
-		else if ( window.ActiveXObject )
-		{
-			try { baseXml = new ActiveXObject( 'MSXML2.DOMDocument' ); }
-			catch(e)
-			{
-				try { baseXml = new ActiveXObject( 'Microsoft.XmlDom' ); } catch(e) {}
-			}
-
-			if ( baseXml )
-			{
-				baseXml.async = false;
-				baseXml.resolveExternals = false;
-				baseXml.validateOnParse = false;
-				baseXml.loadXML( data );
-			}
-		}
-	}
-
-	/**
-	 * The native XML (DOM document) used by the class instance.
-	 * @type object
-	 * @example
-	 */
-	this.baseXml = baseXml;
-};
-
-CKEDITOR.xml.prototype =
-{
-	/**
-	 * Get a single node from the XML document, based on a XPath query.
-	 * @param {String} xpath The XPath query to execute.
-	 * @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 {Object} A XML node element or null if the query has no results.
-	 * @example
-	 * // Create the XML instance.
-	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
-	 * // Get the first <item> node.
-	 * var itemNode = <b>xml.selectSingleNode( 'list/item' )</b>;
-	 * // Alert "item".
-	 * alert( itemNode.nodeName );
-	 */
-	selectSingleNode : function( xpath, contextNode )
-	{
-		var baseXml = this.baseXml;
-
-		if ( contextNode || ( contextNode = baseXml ) )
-		{
-			if ( CKEDITOR.env.ie || contextNode.selectSingleNode )	// IE
-				return contextNode.selectSingleNode( xpath );
-			else if ( baseXml.evaluate )							// Others
-			{
-				var result = baseXml.evaluate( xpath, contextNode, null, 9, null);
-				return ( result && result.singleNodeValue ) || null;
-			}
-		}
-
-		return null;
-	},
-
-	/**
-	 * Gets a list node from the XML document, based on a XPath query.
-	 * @param {String} xpath The XPath query to execute.
-	 * @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 {ArrayLike} An array containing all matched nodes. The array will
-	 *		be empty if the query has no results.
-	 * @example
-	 * // Create the XML instance.
-	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
-	 * // Get the first <item> node.
-	 * var itemNodes = xml.selectSingleNode( 'list/item' );
-	 * // Alert "item" twice, one for each <item>.
-	 * for ( var i = 0 ; i < itemNodes.length ; i++ )
-	 *     alert( itemNodes[i].nodeName );
-	 */
-	selectNodes : function( xpath, contextNode )
-	{
-		var baseXml = this.baseXml,
-			nodes = [];
-
-		if ( contextNode || ( contextNode = baseXml ) )
-		{
-			if ( CKEDITOR.env.ie || contextNode.selectNodes )		// IE
-				return contextNode.selectNodes( xpath );
-			else if ( baseXml.evaluate )							// Others
-			{
-				var result = baseXml.evaluate( xpath, contextNode, null, 5, null);
-
-				if ( result )
-				{
-					var node;
-					while ( ( node = result.iterateNext() ) )
-						nodes.push( node );
-				}
-			}
-		}
-
-		return nodes;
-	},
-
-	/**
-	 * Gets the string representation of hte inner contents of a XML node,
-	 * based on a XPath query.
-	 * @param {String} xpath The XPath query to execute.
-	 * @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 {String} The textual representation of the inner contents of
-	 *		the node or null if the query has no results.
-	 * @example
-	 * // Create the XML instance.
-	 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
-	 * // Alert "<item id="test1" /><item id="test2" />".
-	 * alert( xml.getInnerXml( 'list' ) );
-	 */
-	getInnerXml : function( xpath, contextNode )
-	{
-		var node = this.selectSingleNode( xpath, contextNode ),
-			xml = [];
-		if ( node )
-		{
-			node = node.firstChild;
-			while ( node )
-			{
-				if ( node.xml )				// IE
-					xml.push( node.xml );
-				else if ( window.XMLSerializer )	// Others
-					xml.push( ( new XMLSerializer() ).serializeToString( node ) );
-
-				node = node.nextSibling;
-			}
-		}
-
-		return xml.length ? xml.join( '' ) : null;
-	}
-};
Index: CKEditor/trunk/_source/plugins/ajax/plugin.js
===================================================================
--- CKEditor/trunk/_source/plugins/ajax/plugin.js	(revision 6604)
+++ CKEditor/trunk/_source/plugins/ajax/plugin.js	(revision 6604)
@@ -0,0 +1,152 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.ajax} object, which holds ajax methods for
+ *		data loading.
+ */
+
+(function()
+{
+	CKEDITOR.plugins.add( 'ajax',
+		{
+			requires : [ 'xml' ]
+		});
+
+	/**
+	 * Ajax methods for data loading.
+	 * @namespace
+	 * @example
+	 */
+	CKEDITOR.ajax = (function()
+	{
+		var createXMLHttpRequest = function()
+		{
+			// In IE, using the native XMLHttpRequest for local files may throw
+			// "Access is Denied" errors.
+			if ( !CKEDITOR.env.ie || location.protocol != 'file:' )
+				try { return new XMLHttpRequest(); } catch(e) {}
+
+			try { return new ActiveXObject( 'Msxml2.XMLHTTP' ); } catch (e) {}
+			try { return new ActiveXObject( 'Microsoft.XMLHTTP' ); } catch (e) {}
+
+			return null;
+		};
+
+		var checkStatus = function( xhr )
+		{
+			// HTTP Status Codes:
+			//	 2xx : Success
+			//	 304 : Not Modified
+			//	   0 : Returned when running locally (file://)
+			//	1223 : IE may change 204 to 1223 (see http://dev.jquery.com/ticket/1450)
+
+			return ( xhr.readyState == 4 &&
+					(	( xhr.status >= 200 && xhr.status < 300 ) ||
+						xhr.status == 304 ||
+						xhr.status === 0 ||
+						xhr.status == 1223 ) );
+		};
+
+		var getResponseText = function( xhr )
+		{
+			if ( checkStatus( xhr ) )
+				return xhr.responseText;
+			return null;
+		};
+
+		var getResponseXml = function( xhr )
+		{
+			if ( checkStatus( xhr ) )
+			{
+				var xml = xhr.responseXML;
+				return new CKEDITOR.xml( xml && xml.firstChild ? xml : xhr.responseText );
+			}
+			return null;
+		};
+
+		var load = function( url, callback, getResponseFn )
+		{
+			var async = !!callback;
+
+			var xhr = createXMLHttpRequest();
+
+			if ( !xhr )
+				return null;
+
+			xhr.open( 'GET', url, async );
+
+			if ( async )
+			{
+				// TODO: perform leak checks on this closure.
+				/** @ignore */
+				xhr.onreadystatechange = function()
+				{
+					if ( xhr.readyState == 4 )
+					{
+						callback( getResponseFn( xhr ) );
+						xhr = null;
+					}
+				};
+			}
+
+			xhr.send(null);
+
+			return async ? '' : getResponseFn( xhr );
+		};
+
+		return 	/** @lends CKEDITOR.ajax */ {
+
+			/**
+			 * Loads data from an URL as plain text.
+			 * @param {String} url The URL from which load data.
+			 * @param {Function} [callback] A callback function to be called on
+			 *		data load. If not provided, the data will be loaded
+			 *		synchronously.
+			 * @returns {String} The loaded data. For asynchronous requests, an
+			 *		empty string. For invalid requests, null.
+			 * @example
+			 * // Load data synchronously.
+			 * var data = CKEDITOR.ajax.load( 'somedata.txt' );
+			 * alert( data );
+			 * @example
+			 * // Load data asynchronously.
+			 * var data = CKEDITOR.ajax.load( 'somedata.txt', function( data )
+			 *     {
+			 *         alert( data );
+			 *     } );
+			 */
+			load : function( url, callback )
+			{
+				return load( url, callback, getResponseText );
+			},
+
+			/**
+			 * Loads data from an URL as XML.
+			 * @param {String} url The URL from which load data.
+			 * @param {Function} [callback] A callback function to be called on
+			 *		data load. If not provided, the data will be loaded
+			 *		synchronously.
+			 * @returns {CKEDITOR.xml} An XML object holding the loaded data. For asynchronous requests, an
+			 *		empty string. For invalid requests, null.
+			 * @example
+			 * // Load XML synchronously.
+			 * var xml = CKEDITOR.ajax.loadXml( 'somedata.xml' );
+			 * alert( xml.getInnerXml( '//' ) );
+			 * @example
+			 * // Load XML asynchronously.
+			 * var data = CKEDITOR.ajax.loadXml( 'somedata.xml', function( xml )
+			 *     {
+			 *         alert( xml.getInnerXml( '//' ) );
+			 *     } );
+			 */
+			loadXml : function( url, callback )
+			{
+				return load( url, callback, getResponseXml );
+			}
+		};
+	})();
+
+})();
Index: CKEditor/trunk/_source/plugins/xml/plugin.js
===================================================================
--- CKEditor/trunk/_source/plugins/xml/plugin.js	(revision 6604)
+++ CKEditor/trunk/_source/plugins/xml/plugin.js	(revision 6604)
@@ -0,0 +1,170 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.xml} class, which represents a
+ *		loaded XML document.
+ */
+
+(function()
+{
+	CKEDITOR.plugins.add( 'xml', {});
+
+	/**
+	 * Represents a loaded XML document.
+	 * @constructor
+	 * @param {object|string} xmlObjectOrData A native XML (DOM document) object or
+	 *		a string containing the XML definition to be loaded.
+	 * @example
+	 * var xml = <b>new CKEDITOR.xml( '<books><book title="My Book" /></books>' )</b>;
+	 */
+	CKEDITOR.xml = function( xmlObjectOrData )
+	{
+		var baseXml = null;
+
+		if ( typeof xmlObjectOrData == 'object' )
+			baseXml = xmlObjectOrData;
+		else
+		{
+			var data = ( xmlObjectOrData || '' ).replace( /&nbsp;/g, '\xA0' );
+			if ( window.DOMParser )
+				baseXml = (new DOMParser()).parseFromString( data, 'text/xml' );
+			else if ( window.ActiveXObject )
+			{
+				try { baseXml = new ActiveXObject( 'MSXML2.DOMDocument' ); }
+				catch(e)
+				{
+					try { baseXml = new ActiveXObject( 'Microsoft.XmlDom' ); } catch(e) {}
+				}
+
+				if ( baseXml )
+				{
+					baseXml.async = false;
+					baseXml.resolveExternals = false;
+					baseXml.validateOnParse = false;
+					baseXml.loadXML( data );
+				}
+			}
+		}
+
+		/**
+		 * The native XML (DOM document) used by the class instance.
+		 * @type object
+		 * @example
+		 */
+		this.baseXml = baseXml;
+	};
+
+	CKEDITOR.xml.prototype =
+	{
+		/**
+		 * Get a single node from the XML document, based on a XPath query.
+		 * @param {String} xpath The XPath query to execute.
+		 * @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 {Object} A XML node element or null if the query has no results.
+		 * @example
+		 * // Create the XML instance.
+		 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+		 * // Get the first <item> node.
+		 * var itemNode = <b>xml.selectSingleNode( 'list/item' )</b>;
+		 * // Alert "item".
+		 * alert( itemNode.nodeName );
+		 */
+		selectSingleNode : function( xpath, contextNode )
+		{
+			var baseXml = this.baseXml;
+
+			if ( contextNode || ( contextNode = baseXml ) )
+			{
+				if ( CKEDITOR.env.ie || contextNode.selectSingleNode )	// IE
+					return contextNode.selectSingleNode( xpath );
+				else if ( baseXml.evaluate )							// Others
+				{
+					var result = baseXml.evaluate( xpath, contextNode, null, 9, null);
+					return ( result && result.singleNodeValue ) || null;
+				}
+			}
+
+			return null;
+		},
+
+		/**
+		 * Gets a list node from the XML document, based on a XPath query.
+		 * @param {String} xpath The XPath query to execute.
+		 * @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 {ArrayLike} An array containing all matched nodes. The array will
+		 *		be empty if the query has no results.
+		 * @example
+		 * // Create the XML instance.
+		 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+		 * // Get the first <item> node.
+		 * var itemNodes = xml.selectSingleNode( 'list/item' );
+		 * // Alert "item" twice, one for each <item>.
+		 * for ( var i = 0 ; i < itemNodes.length ; i++ )
+		 *     alert( itemNodes[i].nodeName );
+		 */
+		selectNodes : function( xpath, contextNode )
+		{
+			var baseXml = this.baseXml,
+				nodes = [];
+
+			if ( contextNode || ( contextNode = baseXml ) )
+			{
+				if ( CKEDITOR.env.ie || contextNode.selectNodes )		// IE
+					return contextNode.selectNodes( xpath );
+				else if ( baseXml.evaluate )							// Others
+				{
+					var result = baseXml.evaluate( xpath, contextNode, null, 5, null);
+
+					if ( result )
+					{
+						var node;
+						while ( ( node = result.iterateNext() ) )
+							nodes.push( node );
+					}
+				}
+			}
+
+			return nodes;
+		},
+
+		/**
+		 * Gets the string representation of hte inner contents of a XML node,
+		 * based on a XPath query.
+		 * @param {String} xpath The XPath query to execute.
+		 * @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 {String} The textual representation of the inner contents of
+		 *		the node or null if the query has no results.
+		 * @example
+		 * // Create the XML instance.
+		 * var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
+		 * // Alert "<item id="test1" /><item id="test2" />".
+		 * alert( xml.getInnerXml( 'list' ) );
+		 */
+		getInnerXml : function( xpath, contextNode )
+		{
+			var node = this.selectSingleNode( xpath, contextNode ),
+				xml = [];
+			if ( node )
+			{
+				node = node.firstChild;
+				while ( node )
+				{
+					if ( node.xml )				// IE
+						xml.push( node.xml );
+					else if ( window.XMLSerializer )	// Others
+						xml.push( ( new XMLSerializer() ).serializeToString( node ) );
+
+					node = node.nextSibling;
+				}
+			}
+
+			return xml.length ? xml.join( '' ) : null;
+		}
+	};
+})();
