// Загрузка локализации из файла
  public boolean LoadFromInternalXML(String locale, String internalPath) {
    strings.clear();
    boolean result = false;
    XmlReader reader = new XmlReader();
    try {
      XmlReader.Element root = reader.parse(Gdx.files.internal(internalPath));
      if (root != null) {
        // Проверка на правильность формата файла локализации
        if (root.getName().equalsIgnoreCase("localization")) {
          int load_count = 0;
          // Перебор всех дочерних элементов
          for (int i = 0; i < root.getChildCount(); i++) {
            XmlReader.Element item = root.getChild(i);
            if (item != null) {
              if (item.getName().equalsIgnoreCase("string")) {
                String key = item.getAttribute("key").trim();
                String default_string;
                String value;
                if (key.length() > 0) {
                  Array<XmlReader.Element> find = item.getChildrenByName("default");
                  if (find.size > 0) default_string = find.get(0).getText();
                  else default_string = item.getAttribute("default", "");

                  find = item.getChildrenByName(locale);
                  if (find.size > 0) value = find.get(0).getText();
                  else value = default_string;

                  find.clear();
                  if (value.length() > 0) {
                    strings.put(key, value);

                    if (default_string.length() > 0) translates.put(default_string, value);

                    load_count++;
                  } else {
                    if (default_string.length() > 0) {
                      strings.put(key, default_string);
                      load_count++;
                    }
                  }
                }
              }
            }
          }
          if (load_count > 0) result = true;
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
      strings.clear();
      result = false;
    }
    return result;
  }
  public Actor CreateActorFromElement(XmlReader.Element e) {
    String name = e.getName();
    Actor a = null;

    for (String namespaceName : importedNamespaceNames) {
      Namespace importedNamespace = rootNamespace.namespace(namespaceName);

      if (!importedNamespace.isElementListEmpty()) {
        ArrayList<ElementDirective> DirectiveElements = importedNamespace.getElements();

        for (ElementDirective d : DirectiveElements) {

          if (name.equalsIgnoreCase(d.getName())) {
            a = d.processDirective(null, e);

            if (a != null) {

              if (d.isApplyCommonAttribute()) {
                if (!importedNamespace.isAttributeListEmpty()) {

                  ArrayList<AttributeDirective> CommonAttributes =
                      importedNamespace.getAttributes();
                  for (AttributeDirective ad : CommonAttributes) {
                    a = ad.processDirective(a, e);
                  }
                }
              }
            }

            return a;
          }
        }
      }
    }

    return a;
  }