The present invention provides an automated solution for generating a question
document and an answer document from a database of questions and answers. The solution
utilizes an extensible markup language to define the database. The database is
then converted into a first Document Object Model (DOM) tree. The first DOM tree
may then be used in prompting a user to enter the number of questions from each
section to be generated. Once this input is received, nodes from the first DOM
tree are randomly selected using the data received from the input. These randomly
selected nodes are then used to create a second DOM tree representing the quiz
or test. This second DOM tree may then be converted to a readable or printable
format using a transformation, such as an stylesheet language transformation.