public IMachine createVm(IImage image, IMachineDescriptor machineDescriptor, IComputeCenter computeCenter) throws ConnectorException {
		
		String vmName = createName(Utils.VM_PREFIX);
	
		try {
		//
		// Getting appropriate information for creating recompose body
		//
		String response = doGet(vAppLink);
		
		Document doc = RestClient.stringToXmlDocument(response);
		Element childrenElement = (Element) doc.getElementsByTagName(Constants.CHILDREN).item(0);
		Element vmElement = (Element) childrenElement.getElementsByTagName(Constants.VM).item(0);
		
		String vmType = vmElement.getAttribute(Constants.TYPE);
		String vmRef = vmElement.getAttribute(Constants.HREF);
		
		//
		// Create RecomposeVAppParams body
		//
		DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
		DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
		
		doc = docBuilder.newDocument();
		Element rootElement = doc.createElement(Constants.RECOMPOSE_VAPP);
		doc.appendChild(rootElement);
		
		rootElement.setAttribute("name", getvAppName());
		rootElement.setAttribute("xmlns", Constants.XMLNS);
		rootElement.setAttribute("xmlns:xsi", Constants.XMLNS_XSI);
		rootElement.setAttribute("xmlns:ovf", Constants.XMLNS_OVF);
		
		Element sourcedItem = doc.createElement(Constants.SOURCED_ITEM);
		sourcedItem.setAttribute(Constants.SOURCE_DELETE, "false");
		
		Element source = doc.createElement(Constants.SOURCE);
		source.setAttribute(Constants.TYPE, vmType);
		source.setAttribute(Constants.NAME, vmName);
		source.setAttribute(Constants.HREF, vmRef);
		
		sourcedItem.appendChild(source);
		rootElement.appendChild(sourcedItem);
		
		TransformerFactory tf = TransformerFactory.newInstance();
		Transformer transformer = tf.newTransformer();
		DOMSource dSource = new DOMSource(doc);
		StringWriter writer = new StringWriter();
		StreamResult result= new StreamResult(writer);
		
		transformer.transform(dSource, result);
		String xmlBody = writer.toString();
		
		//
		// sending a POST request
		//
		
		StringEntity entity = new StringEntity(xmlBody);
		entity.setContentType(Constants.RECOMPOSE_VAPP_LINK);
		String createResponse = doPost(vAppLink + Constants.RECOMPOSE_ACTION, entity);
		
		IMachine machine = controllerServices.createMachineInstance(vmName, vmName, computeCenter, machineDescriptor, image, controllerServices.getDefaultAgentPort());
		return machine;
		}
		catch(Exception e){
			throw new ConnectorException(e.getMessage());
		}
	}