private static boolean isValidPrefix(String prefix, Project project) {
    try {
      XmlTag tag = XmlElementFactory.getInstance(project).createTagFromText("<" + prefix + ":foo/>");
      return "foo".equals(tag.getLocalName());
    }
    catch (IncorrectOperationException e) {
      return false;
    }
  }
private static boolean isValidPrefix(String prefix, Project project)