Teachers need to test their students in the most effective way i.e. they need the check to be as easy as possible, with a unique test for each student. This paper shows an example of how to generate a unique test containing cloze questions in a selected LMS. The system of cloze questions consists of a question together with an answer to it in a single task. We propose cloze questions to be generated in the XML structure. The creation procedure written in any programming language or in any appropriate environment is the basis of the generating process. The following items can be used as the procedure inputs-a task with a parameter as an input value, a problem solving function, or an XML template. The XML templates are the formulas of a proposed universal question format for the cloze type of questions according to the XML structure. In this way it is also possible to use other types of questions e.g. numeric or short answer questions. In our example we used the Matlab system to calculate the results of the given problems created from randomly generated input parameters (another environment with similar math libraries can be used in the same way). The randomly generated input parameters of the task are attached to the pattern of the task assignment. These randomly generated input parameters together with the results (calculated by means of the function solving given problem) represent the inputs into the generation process according to the chosen template. The output from this part of the generating process is a file with questions in a universal format. In the next stage we can translate the generated file with the help of the XSTL transformation rules to the appropriate style of the selected LMS. The paper shows an example of a translation into the XML Moodle format which is used for importing questions into the LMS Moodle or a translation into the LaTeX format, which is appropriate for creating questions in PDF. This format is suitable for creating both a teacher's version (with answers) and a student's version (without answers) and it even supports the test completion directly in a PDF document or HTML format suitable for web presentations.