findOrNull

inline fun <T : Element> Element.findOrNull(elementName: String? = null): T?

Finds an element by its type and name. Can return the current element. If elementName is null, only the type is accounted for.