I also have problem with the node.next_sibling("name1"). I have about 100 siblings with "name1". When I loop through them, sometimes the loop reaches the end, but most of the times it abandons in the middle of the length of siblings.
Always in the same position. I checked the XML file and there is no difference. I checked the address (in the debugger) between siblings and when the loop interrupts the address of the next sibling has a larger offset than the other siblings. I do not know why this happens.