Trying your code and adding "@SERROR ?" statements after the CreateObject and the XML.Load commands, I find that both report "The operation completed successfully.". The "-1" is most likely a returned "TRUE" value indicating that it successfully loaded the file.

Thus - it isn't an issue at all, either with Kix or with the XML object.

A function can return TWO values:
1. The Return Value. This is often the data that is the result of a function. For example - pass it "2", the function multiplies it by 4 and returns a value of "8". For functions that don't return "data", the return value is often a TRUE/FALSE indicating that the function had succeeded or not. This is often the opposite of the Return Code (or Status or Error code).
2. Return Code (or Status or Error code). This is the value returned by the Exit command. Exit 0 indicates success (and is often paired with a non-zero Return Value). An exit of non-zero indicates an error, and the Return Value would be zero if an error had occurred.

Not all functions that don't need to return data return a Return Value, but that's a good practice. It simplifies coding - such as:
 Code:
If $XML.Load($Filename)
  ; successful read - continue with the program
Else
  ; failure - look at the error code and determine if any recovery is possible
  'Failed to read ' + $Filename + ' Error reported: ' + @SERROR @CRLF
EndIf
This is a shortcut, eliminating the need to check the error code unless an error actually occurred.
_________________________
Actually I am a Rocket Scientist! \:D