Replace struct xml_string by const char.

This will allow to use standart C functions to work with strings.
Fix xml_open_document().

We shouldn't close file we didn't open.
Also, calculate the file size and allocate necessary buffer without
realocations of memory in cycle.