private Element createLanguages() throws ProfilerException {
        Element languages = doc.createElement("languages");

        /* Check if at least two langauages were inputed */
        if (request.getParameter("stlanguage") != null && !request.getParameter("stlanguage").isEmpty()) {
            languages.appendChild(createLanguageElement(
                    request.getParameter("stlanguage"), request.getParameter("stlanguagelvl")));
        } else {
            request.setAttribute("error", "First two languages are required!");
            throw new ProfilerException("Fill first two languages!");
        }
        if (request.getParameter("ndlanguage") != null && !request.getParameter("ndlanguage").isEmpty()) {
            languages.appendChild(createLanguageElement(
                    request.getParameter("ndlanguage"), request.getParameter("ndlanguagelvl")));
        } else {
            request.setAttribute("error", "First two languages are required!");
            throw new ProfilerException("Fill first two languages!");
        }

        /* Check for other languages and add them if they were inputed */
        if (request.getParameter("rdlanguage") != null && !request.getParameter("rdlanguage").isEmpty()) {
            languages.appendChild(createLanguageElement(
                    request.getParameter("rdlanguage"), request.getParameter("rdlanguagelvl")));
        }
        if (request.getParameter("thlanguage") != null && !request.getParameter("thlanguage").isEmpty()) {
            languages.appendChild(createLanguageElement(
                    request.getParameter("thlanguage"), request.getParameter("thlanguagelvl")));
        }

        return languages;
    }