docs: static Resource createResourceFromDomainModelOp(final ModelNode result, final Set<String> extensions) {
          final Resource root = Resource.Factory.create();
          for (ModelNode model : result.asList()) {
  
              final PathAddress resourceAddress = PathAddress.pathAddress(model.require(DOMAIN_RESOURCE_ADDRESS));
  
              if (resourceAddress.size() == 1) {
                  final PathElement element = resourceAddress.getElement(0);
                  if (element.getKey().equals(EXTENSION)) {
                      if (!extensions.contains(element.getValue())) {
                          extensions.add(element.getValue());
                      }
                  }
              }
  
              Resource resource = root;
              final Iterator<PathElement> i = resourceAddress.iterator();
              if (!i.hasNext()) { //Those are root attributes
                  resource.getModel().set(model.require(DOMAIN_RESOURCE_MODEL));
              }
              while (i.hasNext()) {
                  final PathElement e = i.next();
  
                  if (resource.hasChild(e)) {
                      resource = resource.getChild(e);
                  } else {
                      /*
                      {
                          "domain-resource-address" => [
                              ("profile" => "test"),
                              ("subsystem" => "test")
                          ],
                          "domain-resource-model" => {},
                          "domain-resource-properties" => {"ordered-child-types" => ["ordered-child"]}
                      }*/
                      final Resource nr;
                      if (model.hasDefined(DOMAIN_RESOURCE_PROPERTIES, ORDERED_CHILD_TYPES_PROPERTY)) {
                          List<ModelNode> list = model.get(DOMAIN_RESOURCE_PROPERTIES, ORDERED_CHILD_TYPES_PROPERTY).asList();
                          Set<String> orderedChildTypes = new HashSet<String>(list.size());
                          for (ModelNode type : list) {
                              orderedChildTypes.add(type.asString());
                          }
                          nr = Resource.Factory.create(false, orderedChildTypes);
                      } else {
                          nr = Resource.Factory.create();
                      }
                      resource.registerChild(e, nr);
                      resource = nr;
                  }
  
                  if (!i.hasNext()) {
                      resource.getModel().set(model.require(DOMAIN_RESOURCE_MODEL));
                  }
              }
          }
          return root;
      }