There’s one thing I was wondering about: why would you actually want to use the DOM/XML writing functions of PHP to generate XML? I mean: we’ve been generating HTML without specific functions for over 10 years, so why would we need a library to build a DOM tree instead of outputting XML directly??

Well… I got an answer at PHP Forum: it makes sure your XML is well formed when you spit it out!

Ha! I could have thought about that!

Now I’m wondering if I should be using this as a replacement for echo in order to make sure I generate well formed XHTML all the time… ;) I mean… generating a DOM tree would be overkill, but generating the XHTML code on the fly with XMLwriter might actually work out pretty well…

Hum…