Index: /FCKeditor/trunk/_whatsnew.html
===================================================================
--- /FCKeditor/trunk/_whatsnew.html	(revision 5112)
+++ /FCKeditor/trunk/_whatsnew.html	(revision 5113)
@@ -46,5 +46,6 @@
 		Fixed Bugs:</p>
 	<ul>
-		<li></li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/4642">#4642</a>] Avoided infinite 
+			loop in IE with invalid HTML.</li>
 		<li>Language file updates for the following languages:
 			<ul>
Index: /FCKeditor/trunk/editor/_source/internals/fckxhtml_ie.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckxhtml_ie.js	(revision 5112)
+++ /FCKeditor/trunk/editor/_source/internals/fckxhtml_ie.js	(revision 5113)
@@ -117,7 +117,8 @@
 
 	// Clear the _fckhtmljob attribute.
-	if ( typeof node._fckxhtmljob !== 'undefined' )
-		node.removeAttribute('_fckxhtmljob') ;
-
+	if ( typeof node._fckxhtmljob == 'undefined' && node.tagName !== 'BODY')
+		return;
+
+	node.removeAttribute('_fckxhtmljob') ;
 	// Recurse upon child nodes.
 	if ( node.hasChildNodes() )
@@ -125,5 +126,10 @@
 		var childNodes = node.childNodes ;
 		for ( var i = childNodes.length - 1 ; i >= 0 ; i-- )
-			FCKXHtml._RemoveXHtmlJobProperties( childNodes.item(i) ) ;
+		{
+			var child = childNodes[i];
+			// Funny IE. #4642. It say that it has child nodes but their parent is not this node. Skip them
+			if (child.parentNode == node)
+				FCKXHtml._RemoveXHtmlJobProperties( child ) ;
+		}
 	}
 }
