code: public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, MediaSpec media, NetworkProcessor network)
      {
          SourceData pair = new SourceData(base, network, media);
  
          Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
                  pair, NodeFilter.SHOW_ELEMENT);
  
          StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock();
          traversal.listTraversal(style);
          return style;
      }
docs: Loads all the style sheets used from the specified DOM tree.
  The following style specifications are evaluated:
  <ul>
  <li>The style sheets included using the <code>link</code> and <code>style</code> tags.
  <li>Inline styles specified using the <code>style</code> element attribute.
  <li><strong>Proprietary extension:</strong> Default styles defined using the <code>XDefaultStyle</code>
  element attribute. These styles behave the same way as the inline styles but they have the lowest priority
  (the values are used only when not redefined by any other way)
  </ul>
  
  @param doc
  DOM tree
  @param encoding
  The default encoding used for the referenced style sheets
  @param base
  Base URL against which all files are searched
  @param media
  Selected media for style sheet
  @return the rules of all the style sheets used in the document including the inline styles