draft implementation of XMLReader