Converts an XML document into a dynamic object