Extraction of the XML handling code from ActiveSupport