Schema Extensibility and the any Element
Part 1 of this article showed the basic nuts and bolts of XML Schema and how to apply those features to constraining XML documents. The real power of XML Schema is unleashed when you use it not only to convey document structure, but as a platform-independent metadata language. This article explores features of XML Schema that allow the construction of other schemas that you can extend, and describes how to capture type information in your schemas.
Introduction
By default, all complex types that you create in a custom XML schema have closed content models. This means that only the elements that are specified when the type is declared can appear in instances. While this setup certainly encourages strong typing, it can also be a problem: How do you handle elements within a document that you can't predict ahead of time? Fortunately, this kind of extensibility is supported in XML Schema through use of the any element, which allows you to develop an open content model for a type through the use of wildcards.
Using any within a complex type means that any element can appear at that location, becoming a placeholder for future content that you can't predict while building the type. For attributes, anyAttribute defines placeholders for future attribute extensions.
Of course, you might not want completely arbitrary content to be embedded, so any can be constrained in a number of ways. Don't worry: It will still be very generic even after the constraints!