There is no API to accomplish renaming a domain using virsh. The well known graphical tool `virt-manager` therefore also does not offer the possibility to rename a libvirt domain. In order to do that, you have to stop the virtual machine and edit the .xml data like follows:

root@host ~ # virsh dumpxml machine.example.com > machine.xml
root@host ~ # editor machine.xml

<domain type='kvm' id='24'>
  <name>machine-new.example.com</name>  <== edit the name here
  <uuid>cadb89df-574e-ec7e-31fe-31a33d7934f5</uuid>

root@host ~ # virsh undefine machine.example.com
root@host ~ # virsh define machine.xml