Element result = null;
if (parent != null) {
int me = parent.indexOf(el);
//--- check and see whether the element to be deleted is the last one of its kind
Filter elFilter = new ElementFilter(uName,ns);
if (parent.getContent(elFilter).size() == 1) {
//--- get geonet child element with attribute name = unqualified name
Filter chFilter = new ElementFilter(Edit.RootChild.CHILD, Edit.NAMESPACE);
@SuppressWarnings("unchecked")
List<Element> children = parent.getContent(chFilter);
for (Element ch : children) {
String name = ch.getAttributeValue("name");