$(xml).find('struct:first member:contains("USER_CITY")').find('string').each( function( i, val ) { var userName = $( val ).text(); $('.author_city').append('<a href="$PROFILE_URL$">'+userName+'</a>'); })