code: public synchronized static String toXML(AFPChain afpChain, Atom[] ca1, Atom[]ca2) throws IOException{
  		StringWriter result = new StringWriter();
  		toXML(afpChain,result,ca1,ca2);
  		return result.toString();
  	}
docs: Convert an afpChain to a simple XML representation
  
  @param afpChain
  @return XML representation of the AFPCHain