public static <P extends JpsElement> void saveSourceRoot(@NotNull Element contentElement,
                                                           final @NotNull String rootUrl,
                                                           @NotNull JpsTypedModuleSourceRoot<P> root) {
    Element sourceElement = new Element(SOURCE_FOLDER_TAG);
    sourceElement.setAttribute(URL_ATTRIBUTE, rootUrl);
    JpsModuleSourceRootPropertiesSerializer<P> serializer = getSerializer(root.getRootType());
    if (serializer != null) {
      String typeId = serializer.getTypeId();
      if (!typeId.equals(JAVA_SOURCE_ROOT_TYPE_ID) && !typeId.equals(JAVA_TEST_ROOT_TYPE_ID)) {
        sourceElement.setAttribute(SOURCE_ROOT_TYPE_ATTRIBUTE, typeId);
      }
      serializer.saveProperties(root.getProperties(), sourceElement);
    }
    contentElement.addContent(sourceElement);
  }
public static <P extends JpsElement> void saveSourceRoot(@NotNull Element contentElement,
                                                           final @NotNull String rootUrl,
                                                           @NotNull JpsTypedModuleSourceRoot<P> root)