Altova's XMLSpy has a DTD/XML Schema generator.
The generated DTD/XML Schema usually requires a little tweaking. For example, the tool may enumerate a list of attributes or elements, when you "meant" for it to allow any value. You're only giving it a sample of your problem space, and it has to go from specific to general, though. For that reason, I don't get too bent out of shape when it fails to read my mind.
I consider the generated dtd or schema a starting point. It's better than rolling it by hand from zero. Er, if you're starting with existing XML documents, that is.
Even if you're not going to use the generated dtd, it's a pretty good way to get your head around the structure of a set of unfamiliar XML documents.