public static void processLinks(final @NotNull XmlFile xhtmlFile,
                                  @NotNull Processor<? super XmlTag> tagProcessor) {
    final XmlDocument doc = HtmlUtil.getRealXmlDocument(xhtmlFile.getDocument());
    if (doc == null) return;

    final XmlTag rootTag = doc.getRootTag();
    if (rootTag == null) return;

    if (LINK.equalsIgnoreCase(rootTag.getName())) {
      tagProcessor.process(rootTag);
    }
    else {
      findLinkStylesheets(rootTag, tagProcessor);
    }
  }
public static void processLinks(final @NotNull XmlFile xhtmlFile,
                                  @NotNull Processor<? super XmlTag> tagProcessor)