How to Design XML Documents

  1. Design your XML documents so that they are well-suited for processing by your applications today.
    1. If your XML is intended to be a transport between relational databases, design your XML to be flat, with easy mappings from XML to (relational) database tables.
    2. If you intend to use and manipulate the XML data directly, design easy XPath access points for XSL transforms and XQuery application.
  2. Eliminate nonessential markup (tags). Only use tags that are actually used by your applications today.
  3. Identify likely future expansion points to the XML. For example, would new data members be captured by adding a new attribute? A new element? A new namespace?

In summary, when designing XML:

  • be practical
  • be simple
  • don't use unnecessary tags
  • most likely, "flatter is better"

Thanks to Roger L Costello for the basis of this summary:

http://lists.xml.org/archives/xml-dev/200509/msg00273.html
http://lists.xml.org/archives/xml-dev/200509/msg00278.html