Serializer serializer = SerializerFactory.getSerializer("xml");
Serializer serializer = SerializerFactory.getSerializer (OutputProperties.getDefaultMethodProperties("xml"));
	public static void main(String[] args)    throws TransformerException, TransformerConfigurationException, FileNotFoundException,           ParserConfigurationException, SAXException, IOException  {    	  TransformerFactory tFactory = TransformerFactory.newInstance();    if(tFactory.getFeature(DOMSource.FEATURE) && tFactory.getFeature(DOMResult.FEATURE))    {      // Process the stylesheet StreamSource and generate a Transformer.      Transformer transformer = tFactory.newTransformer(new StreamSource("birds.xsl"));            //Instantiate a DocumentBuilderFactory.      DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();            //Use the DocumentBuilderFactory to create a DocumentBuilder.      DocumentBuilder dBuilder = dFactory.newDocumentBuilder();            //Use the DocumentBuilder to parse the XML input.      Document doc = dBuilder.parse("birds.xml");            // Use the DOM Document to define a DOMSource object.      DOMSource domSource = new DOMSource(doc);            // Set the base URI for the DOMSource so any relative URIs it contains can      // be resolved.      domSource.setSystemId("birds.xml");            // Create an empty DOMResult for the Result.      DOMResult domResult = new DOMResult();    	  // Perform the transformation, placing the output in the DOMResult.      transformer.transform(domSource, domResult);	  	    //Instantiate an XML serializer and use it to serialize the output DOM to System.out	    // using a default output format.      Serializer serializer = SerializerFactory.getSerializer("xml");      serializer.setOutputStream(System.out);      serializer.asDOMSerializer().serialize(domResult.getNode());	}    else    {      throw new org.xml.sax.SAXNotSupportedException("DOM node processing not supported!");    }  }