1. A method for inferring a schema from hierarchical data within an electronic document, comprising: in an application program, receiving the electronic document containing the hierarchical eXtensible Markup Language (XML) data and determining from the electronic document that the hierarchical data within the electronic document does not reference a schema, wherein the hierarchical data includes one or more nodes; (a) discovering one of the nodes in the hierarchical data; (b) saving content associated with the discovered node when the node is not determined to be repeating; (c) repeating tasks (a)-(b) until the content for each discovered node has been saved; and generating the schema based on the content saved for each discovered node; wherein generating the schema comprises writing a schema definition for each node that includes specifying a maximum occurrence of repeating nodes that are out of sequence as unbounded by checking for a repeating indicator and a sequence indicator, wherein the schema is an XML schema that provides the XML data a set of grammatical and data type rules that govern types and a structure of data that may be included in the electronic document.