[164769] IllegalStateException when adding new element using the outline view
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
index ebd0280..b644551 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
@@ -316,7 +316,6 @@
 				compoundCommand.setLabel(fCompoundCommandLabel);
 				compoundCommand.setDescription(fCompoundCommandDescription);
 				compoundCommand.append(textCommand);
-				fCommandStack.execute(compoundCommand);
 
 				fCompoundCommand = compoundCommand;
 			}
@@ -389,6 +388,13 @@
 			if (fRecordingCount > 0)
 				fRecordingCount--;
 			if (fRecordingCount == 0) {
+				
+				// Finally execute the commands accumulated in the compound command.
+				
+				if (fCompoundCommand != null) {
+					fCommandStack.execute(fCompoundCommand);
+				}
+				
 				fRecording = false;
 
 				// reset compound command only when fRecordingCount ==