Updated RawToXML code