Install CPAN module
cpan install XML::XPath
This will install the xpath binary to your system.
xpath /home/user/results.xml '/startNode/childNode1[5]/@attribute'
# or
echo '<tag att1="a1val" att2="a2val" [... attX="aXval"] />' | xpath '//@att2'