You can do this for example, using XML
package:
tt <- '<?xml version="1.0" encoding="utf-8"?>
<item id="rt" name ="th">
<point1>1254</point1>
<point2>1254</point2>
</item>
'
library(XML)
xpathSApply(doc,'//item',xmlGetAttr,'id')
[1] "rt"
EDIT
In case your data is not well formatted, you should reformat your data as I did above or read your data line by line , and extract the information using some regular expression ( not recommended with XML tags to use regex)
tt <- '<item1 id=rt name ="th">
<point1>1254</point1>
<point2>1254</point2>
</item>
'
ll <- readLines(textConnection(tt))
gsub('.*id=(.*)[ ]name.*','\\1',ll[1])
[1] "rt"