code: public Document check(final InputStream input) {
          Document document;
          try {
              final DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
              document = docBuilder.parse(input);
  
              final InputStream is = getClass().getResourceAsStream(xslSchema);
              final Source source = new SAXSource(new InputSource(is));
              checkIsValid(document, source);
          } catch (final SAXException exce) {
              throw new JaxRxException(400, exce.getMessage());
          } catch (final ParserConfigurationException exce) {
              throw new JaxRxException(exce);
          } catch (final IOException exce) {
              throw new JaxRxException(exce);
          }
          return document;
      }
docs: This method parses an XML input with a W3C DOM implementation and
  validates it then with the available XML schema.
  
  @param input
  The input stream containing the XML query.
  @return The parsed XML source as {@link Document}.