Fixed expansion of XMLReader into DOM document.