Though I'm not all that up-to-speed on using it, I have heard murmurings that XML would be a good thing to consider for what you're looking at.
Have you checked into XMLMaker? From what I can gather XML is basically a markup language where you make your own "markup" tags so if you're going with a grid layout system you might benefit from looking into that.
That said, don't ask how to use it of me since I'm still green on XML.