Implement XMLReader::expand()

Should solve #1881