asOrNull

inline fun <T : Element> Element.asOrNull(): T?

Casts the element to the specified class or returns null if it's not an instance of this class.