diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
index 0480472..f22d83b 100644
--- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
@@ -329,22 +329,34 @@
     }
 
     private void deleteDataNode(final String dataspaceName, final String anchorName, final String targetXpath,
-                                final boolean onlySupportListNodeDeletion) {
-        final String parentNodeXpath = targetXpath.substring(0, targetXpath.lastIndexOf('/'));
-        final FragmentEntity parentFragmentEntity = getFragmentByXpath(dataspaceName, anchorName, parentNodeXpath);
-        final String lastXpathElement = targetXpath.substring(targetXpath.lastIndexOf('/'));
-        final boolean isListElement = REG_EX_PATTERN_FOR_LIST_ELEMENT_KEY_PREDICATE.matcher(lastXpathElement).find();
-        boolean targetExist;
-        if (isListElement) {
-            targetExist = deleteDataNode(parentFragmentEntity, targetXpath);
+        final boolean onlySupportListNodeDeletion) {
+        final String parentNodeXpath;
+        FragmentEntity parentFragmentEntity = null;
+        boolean targetDeleted = false;
+        if (isRootXpath(targetXpath)) {
+            deleteDataNodes(dataspaceName, anchorName);
+            targetDeleted = true;
         } else {
-            targetExist = deleteAllListElements(parentFragmentEntity, targetXpath);
-            final boolean tryToDeleteDataNode = !targetExist && !onlySupportListNodeDeletion;
-            if (tryToDeleteDataNode) {
-                targetExist = deleteDataNode(parentFragmentEntity, targetXpath);
+            if (isContainerNodeXpath(targetXpath)) {
+                parentNodeXpath = targetXpath;
+            } else {
+                parentNodeXpath = targetXpath.substring(0, targetXpath.lastIndexOf('/'));
+            }
+            parentFragmentEntity = getFragmentByXpath(dataspaceName, anchorName, parentNodeXpath);
+            final String lastXpathElement = targetXpath.substring(targetXpath.lastIndexOf('/'));
+            final boolean isListElement = REG_EX_PATTERN_FOR_LIST_ELEMENT_KEY_PREDICATE
+                .matcher(lastXpathElement).find();
+            if (isListElement) {
+                targetDeleted = deleteDataNode(parentFragmentEntity, targetXpath);
+            } else {
+                targetDeleted = deleteAllListElements(parentFragmentEntity, targetXpath);
+                final boolean tryToDeleteDataNode = !targetDeleted && !onlySupportListNodeDeletion;
+                if (tryToDeleteDataNode) {
+                    targetDeleted = deleteDataNode(parentFragmentEntity, targetXpath);
+                }
             }
         }
-        if (!targetExist) {
+        if (!targetDeleted) {
             final String additionalInformation = onlySupportListNodeDeletion
                 ? "The target is probably not a List." : "";
             throw new DataNodeNotFoundException(parentFragmentEntity.getDataspace().getName(),
@@ -353,6 +365,10 @@
     }
 
     private boolean deleteDataNode(final FragmentEntity parentFragmentEntity, final String targetXpath) {
+        if (parentFragmentEntity.getXpath().equals(targetXpath)) {
+            fragmentRepository.delete(parentFragmentEntity);
+            return true;
+        }
         if (parentFragmentEntity.getChildFragments()
             .removeIf(fragment -> fragment.getXpath().equals(targetXpath))) {
             fragmentRepository.save(parentFragmentEntity);
@@ -361,7 +377,6 @@
         return false;
     }
 
-
     private boolean deleteAllListElements(final FragmentEntity parentFragmentEntity, final String listXpath) {
         final String deleteTargetXpathPrefix = listXpath + "[";
         if (parentFragmentEntity.getChildFragments()
@@ -384,7 +399,7 @@
                 "Cannot replace list elements with empty collection");
         }
         final String firstChildNodeXpath = newListElements.iterator().next().getXpath();
-        return firstChildNodeXpath.substring(0, firstChildNodeXpath.lastIndexOf("[") + 1);
+        return firstChildNodeXpath.substring(0, firstChildNodeXpath.lastIndexOf('[') + 1);
     }
 
     private FragmentEntity getFragmentForReplacement(final FragmentEntity parentEntity,
@@ -408,6 +423,10 @@
         return !existingListElementsByXpath.containsKey(replacementDataNode.getXpath());
     }
 
+    private static boolean isContainerNodeXpath(final String xpath) {
+        return 0 == xpath.lastIndexOf('/');
+    }
+
     private void copyAttributesFromNewListElement(final FragmentEntity existingListElementEntity,
                                                          final DataNode newListElement) {
         final FragmentEntity replacementFragmentEntity =
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy
index 2277377..ab29005 100755
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy
@@ -511,6 +511,11 @@
             'child data node, parent still exists'  | '/parent-206/child-206'                            | '/parent-206'                                     || '/parent-206'
             'list element'                          | '/parent-206/child-206/grand-child-206[@key="A"]'  | '/parent-206/child-206/grand-child-206[@key="A"]' || null
             'list element, sibling still exists'    | '/parent-206/child-206/grand-child-206[@key="A"]'  | '/parent-206/child-206/grand-child-206[@key="X"]' || '/parent-206/child-206/grand-child-206[@key="X"]'
+            'container node'                        | '/parent-206'                                      | '/parent-206'                                     || null
+            'container list node'                   | '/parent-206[@key="A"]'                            | '/parent-206[@key="B"]'                           || '/parent-206[@key="B"]'
+            'root node with xpath /'                | '/'                                                | '/'                                               || null
+            'root node with xpath passed as blank'  | ''                                                 | ''                                                || null
+
     }
 
     @Sql([CLEAR_DATA, SET_DATA])
diff --git a/cps-ri/src/test/resources/data/fragment.sql b/cps-ri/src/test/resources/data/fragment.sql
index 49c4c9f..a27bb5f 100755
--- a/cps-ri/src/test/resources/data/fragment.sql
+++ b/cps-ri/src/test/resources/data/fragment.sql
@@ -2,7 +2,7 @@
    ============LICENSE_START=======================================================
     Copyright (C) 2021 Nordix Foundation.
     Modifications Copyright (C) 2021 Pantheon.tech
-    Modifications Copyright (C) 2021 Bell Canada.
+    Modifications Copyright (C) 2021-2022 Bell Canada.
    ================================================================================
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -64,4 +64,7 @@
     (4227, 1001, 3003, 4226, '/parent-206/child-206', '{}'),
     (4228, 1001, 3003, 4227, '/parent-206/child-206/grand-child-206', '{}'),
     (4229, 1001, 3003, 4227, '/parent-206/child-206/grand-child-206[@key="A"]', '{"key": "A"}'),
-    (4230, 1001, 3003, 4227, '/parent-206/child-206/grand-child-206[@key="X"]', '{"key": "X"}');
+    (4230, 1001, 3003, 4227, '/parent-206/child-206/grand-child-206[@key="X"]', '{"key": "X"}'),
+    (4231, 1001, 3003, null, '/parent-206[@key="A"]', '{"key": "A"}'),
+    (4232, 1001, 3003, 4231, '/parent-206[@key="A"]/child-206', '{}'),
+    (4233, 1001, 3003, null, '/parent-206[@key="B"]', '{"key": "B"}');
\ No newline at end of file
