Close Tab in Safari?

I have a script that copies the text from a webpage. When the script finishes I would like it to close the tab. Is this possible? If so can someone point me in the right direction??

tell application "Safari" to activate
tell application "System Events"
	tell process "Safari"
		click menu item "Close Tab" of menu "File" of menu bar item "File" of menu bar 1
		--> or substitute the line below for the line above
		--> keystroke "w" using {command down}
	end tell
end tell

This use of UI Scripting assumes you have “Enable access for assistive devices” checked in System Prefs–>Universal Access.

After playing around for a while I came up with the Keystroke command you suggested but


		click menu item "Close Tab" of menu "File" of menu bar item "File" of menu bar 1

Looks a lot cleaner.

Thanks for the help.