Node sourceTree = docBuilder.parse(xmlSource);
Node sourceTree = docBuilder.parse(xmlSource.getByteStream());
  public static String getXSLURLfromDoc(InputSource xmlSource,                                        String attributeName,                                        String attributeValue,                                        Processor processor)  {    String tempURL = null, returnURL = null;    try    {	  DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();      DocumentBuilder docBuilder = dfactory.newDocumentBuilder();      Node sourceTree = docBuilder.parse(xmlSource);      for(Node child=sourceTree.getFirstChild(); null != child; child=child.getNextSibling())      {        if(Node.PROCESSING_INSTRUCTION_NODE == child.getNodeType())        {          ProcessingInstruction pi = (ProcessingInstruction)child;          if(pi.getNodeName().equals("xml-stylesheet"))          {            PIA pia = new PIA(pi);            if("text/xsl".equals(pia.getAttribute("type")))            {              tempURL = pia.getAttribute("href");              String attribute = pia.getAttribute(attributeName);              if ((attribute != null) && (attribute.indexOf(attributeValue) > -1))                return tempURL;              if (!"yes".equals(pia.getAttribute("alternate")))                returnURL = tempURL;            }          }        }      }    }    catch(Exception saxExc)    {    }    return returnURL;  }  