Production: Creating XML Structure documentation

Let's step to the other side and imagine we have to document some non-trivial XML structure. If there are no previously set rules and guidelines, we're faced with some tough choices: how deep or shallow should the documentation be, what format are we're going to use, how are we going to produce and maintain it?

These questions need in answer, but maybe we should start with acknowledging something important: for most people it's not a pleasant prospect at all!. You're deep-down in some code that will be used by others, you created some clever XML format, and suddenly you realize that, for people to be able to use your skilfully designed contraption, this format, that grew a little out of hand, needs documentation. Argh. A depressive sinking feeling overwhelms you… But why is that?

So how to approach this? Before we go in to this, let's make a little side step and look at something that might be going through your mind already: Of course the XML structure in question has a schema of some sort. Can't we use that for (generating) documentation?