For some reason the selectSingleNode() statement is not returning a reference to that node. You will have to alter the XPath to correctly select the node. It does sound like there might be a namespace issue here, but if this is just a 2DS that you imported into the form then there shouldn't be a namespace problem. Maybe the 'item' row hasn't been inserted at the time that this code is called?
You could add a IF block that tests to see if the node is null, and if so, quits.
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge