27. A method for generating a modified schema, comprising: using a computer system, receiving an input schema, the input schema specifying how to represent one or more elements in a document; using a computer system, receiving one or more instance documents; and using a computer system, generating one or more rules from the one or more instance documents; using a computer system, analyzing the input schema for conformance to the one or more rules; and using a computer system, if the input schema does not conform to the one or more rules, generating a modified schema based on the input schema, the modified schema specifying how to represent the one or more elements in the document in conformance with the one or more rules.
27. A method for generating a modified schema, comprising: using a computer system, receiving an input schema, the input schema specifying how to represent one or more elements in a document; using a computer system, receiving one or more instance documents; and using a computer system, generating one or more rules from the one or more instance documents; using a computer system, analyzing the input schema for conformance to the one or more rules; and using a computer system, if the input schema does not conform to the one or more rules, generating a modified schema based on the input schema, the modified schema specifying how to represent the one or more elements in the document in conformance with the one or more rules. 34. The method of claim 27 , further comprising: identifying a pattern from one or more element instances provided by the one or more instance documents, and generating a rule that limits elements to the pattern.