if (leniant) {
child = getFirstChild();
while (child != null) {
if (child instanceof NamedPsiElement) {
NamedPsiElement namedPsiElement = (NamedPsiElement) child;
if (namedPsiElement.matches(element)) {
return true;
}
}
child = child.getNextSibling();
}