I would need more examples on using rbv_api.evalXpath function. This is my error:

/* Initialization code injected by validation and debug process */
var rbv_debugFormula = true;
/* End Initialization code injected by validation and debug process */

var xmlString = rbv_api.getTextData("Upload", 12619109, "uploadf_document");

//rbv_api.println("xmlString = " + xmlString);

var myXpathstar            = "/Tyres/*";

var myXpathId             = "Tyre/ID/text()";

var myXpathnext            = "Tyre/*";

var loop = rbv_api.evalXpath(xmlString, myXpathstar);

var loop2 = rbv_api.evalXpath(xmlString, myXpathnext);

for (var k=0; k<loop2.length; k++) {
 
  var nodename1 = rbv_api.evalXpath(xmlString, myXpathnext).item(k).getNodeName();
 
  rbv_api.println("Name 1 = " + nodename1);
 
    
       var v_ID =  rbv_api.evalXpath(xmlString, myXpathId).item(k).getNodeValue();  

         rbv_api.println("ID = " + v_ID +  " nummer " + k);

        var v_ID = "";
     

}

Name 1 = ID
ID = 226368 nummer 0
Name 1 = BACCode
ID = 226367 nummer 1
Name 1 = EANCode
ID = 226369 nummer 2
Name 1 = Definition
Error  Cannot call method "getNodeValue" of null (line #31) in formula: