Using xgrep, you can pull out the IP address with xpath.
Code:
wget -q --user-agent="" -O - http://ip-address.domaintools.com/myip.xml | # no user agent
xgrep -x "/dnstools/ip_address/text()" | # pull out <ip_address>
grep --invert-match -i "<" # remove comment lines with inverted regex
I've used ip-address.com because it gives you the option of an XML output of the IP info. The above code is only for purposes of an example and you must seek permission of the site owner or consult their fair usage policy if you intend to use the as part of an automated process for commercial or non commercial purposes.