Index: /CKEditor/branches/prototype/_samples/sample.html
===================================================================
--- /CKEditor/branches/prototype/_samples/sample.html	(revision 2344)
+++ /CKEditor/branches/prototype/_samples/sample.html	(revision 2345)
@@ -40,4 +40,9 @@
 	<script type="text/javascript" src="sample.js"></script>
 	<link type="text/css" rel="stylesheet" href="sample.css" />
+	<script type="text/javascript">
+	//<![CDATA[
+		document.write( CKEDITOR.samples.headScript );
+	//]]>
+	</script>
 </head>
 <body>
Index: /CKEditor/branches/prototype/_samples/sample.js
===================================================================
--- /CKEditor/branches/prototype/_samples/sample.js	(revision 2344)
+++ /CKEditor/branches/prototype/_samples/sample.js	(revision 2345)
@@ -51,27 +51,15 @@
 			if ( sampleData )
 			{
-				var getDivContents = function ( id )
+				var getNodeHtml = function ( id )
 				{
-					try
-					{
-						// The '//div[@id="html"]' XPath doesn't work with
-						// <html xmlns"..."> in FF, Safari and Opera.
-						return sampleData.getOuterXml( '//*[name()="div"][@id="' + id + '"]' );
-					}
-					catch(e)
-					{
-						// In IE instead, the "name()" expression is not
-						// understood, but xmlns doens't disturb it.
-						return sampleData.getOuterXml( '//div[@id="' + id + '"]' );
-					}
+					return sampleData.getInnerXml( '//*[@id="' + id + '"]' );
 				};
 
-				var html = getDivContents( 'html' );
-				if ( html )
-					samples.htmlData = html;
-
-				html = getDivContents( 'code' );
-				if ( html )
-					samples.codeData = html;
+				samples.headScript = getNodeHtml( 'headscript' ) || '';
+				samples.htmlData = getNodeHtml( 'html' ) || '';
+				samples.codeData = getNodeHtml( 'code' ) || '';
+				
+				if ( samples.headScript )
+					samples.headScript = '<script id="headscript" type="text/javascript">' + samples.headScript + '</script>';
 			}
 		}
Index: /CKEditor/branches/prototype/_source/core/ajax.js
===================================================================
--- /CKEditor/branches/prototype/_source/core/ajax.js	(revision 2344)
+++ /CKEditor/branches/prototype/_source/core/ajax.js	(revision 2345)
@@ -144,10 +144,10 @@
 		 * // Load XML synchronously.
 		 * var xml = CKEDITOR.ajax.loadXml( 'somedata.xml' );
-		 * alert( xml.getOuterXml() );
+		 * alert( xml.getInnerXml( '//' ) );
 		 * @example
 		 * // Load XML asynchronously.
 		 * var data = CKEDITOR.ajax.loadXml( 'somedata.xml', function( xml )
 		 *     {
-		 *         alert( xml.getOuterXml() );
+		 *         alert( xml.getInnerXml( '//' ) );
 		 *     } );
 		 */
Index: /CKEditor/branches/prototype/_source/core/xml.js
===================================================================
--- /CKEditor/branches/prototype/_source/core/xml.js	(revision 2344)
+++ /CKEditor/branches/prototype/_source/core/xml.js	(revision 2345)
@@ -145,28 +145,36 @@
 
 	/**
-	 * Gets the string representation of a XML node, based on a XPath query.
+	 * 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 XML node or null if
-	 *		the query has no results.
+	 * @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" />".
-	 * alert( xml.getOuterXml( 'list/item' ) );
+	 * // Alert "<item id="test1" /><item id="test2" />".
+	 * alert( xml.getInnerXml( 'list' ) );
 	 */
-	getOuterXml : function( xpath, contextNode )
+	getInnerXml : function( xpath, contextNode )
 	{
-		var node = this.selectSingleNode( xpath, contextNode );
+		var node = this.selectSingleNode( xpath, contextNode ),
+			xml = [];
 		if ( node )
 		{
-			if ( node.xml )				// IE
-				return node.xml;
-			else if ( window.XMLSerializer )	// Others
-				return ( new XMLSerializer() ).serializeToString( 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 null;
+		return xml.length ? xml.join( '' ) : null;
 	}
 };
Index: /CKEditor/branches/prototype/_source/tests/core/xml.html
===================================================================
--- /CKEditor/branches/prototype/_source/tests/core/xml.html	(revision 2344)
+++ /CKEditor/branches/prototype/_source/tests/core/xml.html	(revision 2345)
@@ -113,20 +113,20 @@
 		},
 
-		test_getOuterXml1 : function()
+		test_getInnerXml1 : function()
 		{
 			var xml = new CKEDITOR.xml( '<data><item/></data>' );
-			assert.areEqual( '<data><item/></data>', xml.getOuterXml( 'data' ) );
+			assert.areEqual( '<item/>', xml.getInnerXml( 'data' ) );
 		},
 
-		test_getOuterXml2 : function()
+		test_getInnerXml2 : function()
+		{
+			var xml = new CKEDITOR.xml( '<data><item id="x1"><subitem name="sub1"/></item></data>' );
+			assert.areEqual( '<subitem name="sub1"/>', xml.getInnerXml( '//item' ) );
+		},
+
+		test_getInnerXml3 : 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' ) );
+			assert.isNull( xml.getInnerXml( '//itemX' ) );
 		},
 
