core: reformat code and fix small issues in BinaryXMLParser