Please use Ci.nsIDOMNode.ELEMENT_NODE instead of 1.