Show your xml. Also, you if you select /@attribute you will get an attribute list, so not need to additionally look if it is a tag or an attribute.
–
Artjom B.May 27 '14 at 11:06

Thanks for the answer..my xml file is not special what I want to do is that if the given xpath indicates an attribute my function should replace it's value with '' : for example if my xml file is like : <root attribute="hello"/> and xpath is : /root/@hello I want to find a way to transform it into <root attribute=""/>
–
user3328690May 27 '14 at 11:19

Did my answer help? If yes, please accept it. If not, what was the issue.
–
Artjom B.Jun 6 '14 at 14:14