Registry now directly reads from the File instead of a buffer

Currently we read the whole XML file into a large buffer, then parse it.
This PR would make it parse directly while reading the file.