There is a way, suppose you have store your VM name in a string name as an Input and your output is vmname with VC:VirtualMachine type
Input >> string >> name
Output >> VC:VirtualMachine >> vmname
#####Convert String to VC:VirtualMachine type
name = "virtulamachinestringname"
query = "xpath:name='"+name+"'";
name = Server.findAllForType("VC:VirtualMachine", query);
vmname = name[0];