Down-casting in contrast is totally fine, since it inherits from nsIDOMNode. But the other way around isn't.
Do you mean up-casting (casting from a more specific type to a less specific type)? Because I'm about to leave a review comment about down-casting (casting from a less specific type to a more specific type).