docs: static String responseToXml(String endpointName, ApiResponse response) throws ApiException {
  		try {
  			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
  			DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
  	
  			Document doc = docBuilder.newDocument();
  			Element rootElement = doc.createElement(endpointName);
  			doc.appendChild(rootElement);
  			response.toXML(doc, rootElement);
  			
  			TransformerFactory transformerFactory = TransformerFactory.newInstance();
  			Transformer transformer = transformerFactory.newTransformer();
  			DOMSource source = new DOMSource(doc);
  			
  			StringWriter sw = new StringWriter();
  			StreamResult result =  new StreamResult(sw);
  			transformer.transform(source, result);
  			
  			return sw.toString();
  
  		} catch (Exception e) {
  			logger.error("Failed to convert API response to XML: " + e.getMessage(), e);
  			throw new ApiException(ApiException.Type.INTERNAL_ERROR, e);
  		}
  	}