1 ) A structured document processing apparatus performing syntax parsing of a structured document in the form of electronic data, comprising: an automaton generating unit which generates a state transition sequence of a plurality of states enabling sectioning of a structured document into a plurality of nodes; an instance document analyzing unit which integrates state transitions in the state transition sequence generated by the automaton generating unit by using statistical information regarding an instance document which is the entity of the structured document and statistically obtains patterns in the number of occurrences of repetitive elements in the state transitions by using the statistical information; a schema information analyzing unit which integrates the state transitions in the state transition sequence generated by the automaton generating unit by using schema information which defines the structure and format of information regarding the structured document; and an automaton optimizing unit which mutually optimizes automatons integrated by the instance document analyzing unit and the schema information analyzing unit.