Bug 526979 - XMLDocumentService.cleanTags() duplicate text fragments.

Change-Id: Iad20fe2d03e6b9fcee29dd6a2d0a2c2e90157f21
Signed-off-by: Antonio Campesino <antonio.campesino.robles@ericsson.com>
diff --git a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java
index 1cb61c8..7cd56d0 100644
--- a/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java
+++ b/plugins/org.eclipse.gendoc.documents/src/org/eclipse/gendoc/documents/XMLDocumentService.java
@@ -10,6 +10,7 @@
  * Contributors:
  *  Caroline Bourdeu d'Aguerre (Atos Origin) caroline.bourdeudaguerre@atosorigin.com - Initial API and implementation
  *  Anne Haugommard (Atos) anne.haugommard@atos.net - improvement in clean process
+ *  Antonio Campesino (Ericsson) - Fixing clean process removing duplicate fragments (Bug 526979)
  *
  *****************************************************************************/
 package org.eclipse.gendoc.documents;
@@ -324,6 +325,8 @@
         // 1. Find next node with starting tag character
 
         Node firstNode = findNodeWithOneTag(currentNode);
+        firstNode = getBestAscendantUntil(currentNode, firstNode); // firstNode == null if not contained in current node
+        
         Node next = cleanTags(currentNode, tagLabels, firstNode);
         if (currentNode == null || currentNode.getParentNode() == null)
         {