assertNotNull(resource);
    public void testSerialize2( ) throws Exception{    	System.out.println("Xerces version: "+org.apache.xerces.impl.Version.getVersion( ));    	Document doc = javax.xml.parsers.DocumentBuilderFactory.newInstance( ).newDocumentBuilder().parse(testFile);    	XMLResource resource = (XMLResource) c.createResource(null, "XMLResource");    	resource.setContentAsDOM(doc);    	System.out.println("Storing resource: "+resource.getId( ));    	c.storeResource(resource);    	resource = (XMLResource)c.getResource(resource.getId());    	Node node = resource.getContentAsDOM();    	System.out.println("Attempting serialization using XMLSerializer");    	OutputFormat format = new OutputFormat( );    	format.setLineWidth(0);    	format.setIndent(5);    	format.setPreserveSpace(true);    	ByteArrayOutputStream out = new ByteArrayOutputStream( );    	XMLSerializer serializer = new XMLSerializer(out, format);    	if(node instanceof Document){    		serializer.serialize((Document) node);    	}else if(node instanceof Element){    		serializer.serialize((Element) node);    	}else{    		throw new Exception("Can't serialize node type: "+node);    	}    	System.out.println("Using org.apache.xml.serialize.XMLSerializer");    	System.out.println("---------------------");    	System.out.println(new String(out.toByteArray()));    	System.out.println("--------------------- ");    }