public void deleteGroup(LanguageGroup group, LanguageGroup parent, Language language) {
   Element languageElement = this.getLanguageElement(language);
   Element parentElement = getParentElement(parent, language);
   Element groupElement = factory.getGroupElement(languageElement, group);
   if (parentElement != null && groupElement != null) {
     parentElement.removeChild(groupElement);
     writeDocument();
   }
 }
 public boolean editGroup(LanguageGroup group, Language language) {
   Element languageElement = this.getLanguageElement(language);
   Element element = factory.getGroupElement(languageElement, group);
   if (element != null) {
     factory.groupToElement(group, element);
     writeDocument();
     return true;
   }
   return false;
 }
  private Element getParentElement(LanguageGroup parent, Language language) {
    Element languageElement = this.getLanguageElement(language);
    Element parentElement = null;
    if (parent == language) {
      parentElement = languageElement;
    } else {
      parentElement = factory.getGroupElement(languageElement, parent);
    }

    return parentElement;
  }