Today I get to learn how to use xmllint properly. It does not seem to be well covered or explained. I plan to use a single language resource file to run my entire system.
I had the same problem a few minutes ago and saw this post.
After hacking a bit I found the following solution to extract the city:
(
wget 'http://maps.googleapis.com/maps/api/geocode/xml?latlng=53.244921,-2.479539&sensor=true' \
-O dummy.xml -o /dev/null
xmllint --format \
--xpath '/GeocodeResponse/result[type = "postal_town"]/address_component[type = "postal_town"]/short_name/node()' \
dummy.xml
)
You nee to specify the correct X-Path to get the desired XML-Tag and then return only the node value.