1. An information processing apparatus which parses an XML document and converts the XML document into tree structure data including an element and an attribute upon processing the XML document by an application, comprising: determination unit configured to, when an instruction from a user is input via the application, determine whether or not the instruction is an instruction including a change of a value of the attribute; event generation unit configured to, when said determination unit determines that the instruction is not the instruction including the change of the value of the attribute, generate a first event which describes contents of the instruction, and for, when said determination unit determines that the instruction is the instruction including the change of the value of the attribute, acquiring type information of the value of the attribute and generate a second event which describes the type information and contents of the instruction; and event processing unit configured to receive one of the first event and the second event generated by said event generation unit, and executing processing based on the event, wherein said event processing unit processes the instruction contents as a character string upon reception of the first event, and processes the instruction contents according to the type information upon reception of the second event.