Magento create custom page layout

Magento create custom page layout :Use setTemplate code to apply custom template to any page / category /product view /etc..
Template of Any page on site can be changed with just below code

<reference name="root">
 <action method="setTemplate"><template>page/empty.phtml</template></action>
</reference>
<checkout_cart_index translate="label"> 
  <reference name="root"> 
     <action method="setTemplate">
        <template>page/2columns-left.phtml</template>
     </action> 
  </reference> 
</checkout_cart_index>