[jQuery] Error: d[i].getElementsByTagName is not a function

[jQuery] Error: d[i].getElementsByTagName is not a function


$("//hooks/errors/error",data);
If my XML contains an error node, everything is okay. If it does not
contain an error node, I get the following error:
"Error: d[i].getElementsByTagName is not a function"
Shouldn't it just return null?
Thanks.
Brian