Xpath is language using we can get the element of the xml.
So probably you are thinking about how to create xpath using xpath language.
My point of view you should remember below mentioned point whenever you are creating xpath.
1) Always create short xpath.
2) Don’t use dynamic data(Like className,id.. etc) in xpath.
3) If you are feeling that your browser text(like button name ,link text,textbox text etc) are not changing frequently then you should use text only.
Like xpaths for link:-
//*[starts-with(text(),"in your mind)]
//*[@value='Login'] or //*[@*='Login']
3) If same page having more than one xpath then use postion or create xpath depending upon the other text/control.
if you want to access last button
if all the button/links are getting displayed whenever you are using position=1 then use following xpath and mention postion according your requirment.
create xpath depending upon the other text/control:
for more details about the above mentioned functions refer following link http://www.w3.org/TR/xpath20/.
4) After creating xpath,verify same using xpath checker/firebug/xpather plugin.These are firefox plugin.
if above mentioned plugins are displaying same control as your browser.then your xpath is correct :-)