private static @Nullable XmlNSDescriptor getNSDescriptorFromMetaData(@NotNull XmlDocument document,
                                                                       @Nullable PsiMetaOwner metaOwner,
                                                                       boolean nonEmpty) {
    if (metaOwner == null) return null;
    XmlNSDescriptor descriptor = (XmlNSDescriptor)metaOwner.getMetaData();
    if (descriptor == null) return null;
    if (nonEmpty && descriptor.getRootElementsDescriptors(document).length == 0) {
      return null;
    }
    return descriptor;
  }
private static @Nullable XmlNSDescriptor getNSDescriptorFromMetaData(@NotNull XmlDocument document,
                                                                       @Nullable PsiMetaOwner metaOwner,
                                                                       boolean nonEmpty)