code: public WireFeed build(final Document document) throws IllegalArgumentException, FeedException {
          final WireFeedParser parser = getFeedParsers().getParserFor(document);
          if (parser == null) {
              throw new IllegalArgumentException("Invalid document");
          }
          return parser.parse(document, validate, locale);
      }
docs: Builds an WireFeed (RSS or Atom) from an JDOM document.
  <p>
  NOTE: All other build methods delegate to this method.
  <p>
  
  @param document JDOM document to read to create the WireFeed.
  @return the WireFeed read from the JDOM document.
  @throws IllegalArgumentException thrown if feed type could not be understood by any of the
  underlying parsers.
  @throws FeedException if the feed could not be parsed