I am writing an Apache handler in PHP to transform XML. The two methods I am considering, using the XML parser, are either building a new DOMDocument and transforming it or performing on-the-fly transformation by writing tag handlers for the custom tags. For some reason, I can't seem to think through what would be the best approach to use. Thank you.