private static @Nullable XmlAttribute getAttributeByName(@NotNull XmlTag tag, @NotNull String name) {
    PsiElement child = tag.getFirstChild();
    while (child != null) {
      if (child instanceof XmlAttribute) {
        PsiElement nameElement = child.getFirstChild();
        if (nameElement != null &&
            nameElement.getNode().getElementType() == XmlTokenType.XML_NAME &&
            name.equalsIgnoreCase(nameElement.getText())) {
          return (XmlAttribute)child;
        }
      }
      child = child.getNextSibling();
    }
    return null;
  }
private static @Nullable XmlAttribute getAttributeByName(@NotNull XmlTag tag, @NotNull String name)