code: private static void outputRaDesc(RaImpl raImpl, PrintStream out) throws ParserConfigurationException, SAXException,
           IOException, TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException
     {
        String raString = "<resource-adapters>" + raImpl.toString() + "</resource-adapters>";
  
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(new InputSource(new StringReader(raString)));
        
        out.println();
        out.println("Deployment descriptor:");
        out.println("----------------------");
  
        TransformerFactory tfactory = TransformerFactory.newInstance();
        Transformer serializer;
  
        serializer = tfactory.newTransformer();
        //Setup indenting to "pretty print"
        serializer.setOutputProperty(OutputKeys.INDENT, "yes");
        serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
  
        serializer.transform(new DOMSource(doc), new StreamResult(out));
     }
docs: Output Resource Adapter XML description
  
  @param raImpl RaImpl
  @param out PrintStream
  @throws ParserConfigurationException
  @throws SAXException
  @throws IOException
  @throws TransformerFactoryConfigurationError
  @throws TransformerConfigurationException
  @throws TransformerException