For example, the following code compiles the schema in myXSDFile
in the presence of only the minimal builtin type system.
The resulting SchemaTypeSystem sts contains only the definitions
from myXSD file. In order to load and validate an instance within
the context of those types, we must next construct a
SchemaTypeLoaderstl that contains both
the builtin type system and the types defined within the myXSD file.

A SchemaTypeSystem is useful when you need to enumerate the exact set
of component definitions derived from a set of XSD files, for example,
when you are analyzing the contents of the XSD files themselves.
Here is how to use a SchemaTypeSystem to inspect a set of schema
definitions:

A document type is a type that contains a single global element; there
is one document type for each global element definition in a
SchemaTypeSystem. In an instance document, only the root XmlObject
can have a document type as its type.

Similarly, an attribute type is a type that contains a single global
attribute, and there is one attribute type for each global attribute
definition in a SchemaTypeSystem. It is possible to have a root
XmlObject representing a fragment whose type is an attribute type,
but attribute types are present mainly for symmetry and to simplify
code such as the type-tree-walking code below.

The global component methods above only provide a view of the top-level
components of a SchemaTypeSystem and do not include any nested
definitions. To view all the nested definitions, you will want to
traverse the entire tree of SchemaType defintions within a
SchemaTypeSystem by examining the SchemaType.getAnonymousTypes()
within each SchemaType recursively.

The following code is a standard treewalk that visits every
SchemaType in the SchemaTypeSystem once, including nested
definitions.