I want to extract the language code and AlternateName

How do I do that ?

HTML Code:
<alternateName lang="ar">أمريكا الجنوبية</alternateName>
<alternateName lang="bg">Южна Америка</alternateName>
<alternateName lang="bs">Južna Amerika</alternateName>
<alternateName lang="ca">Amčrica del Sud</alternateName>
<alternateName lang="cai">Abya Yala</alternateName>
<alternateName lang="cs">Jižní Amerika</alternateName>
<alternateName lang="cy">De America</alternateName>
<alternateName lang="da">Sydamerika</alternateName>
<alternateName lang="de">Südamerika</alternateName>
<alternateName lang="el">Νότια Αμερική</alternateName>
<alternateName lang="en">South America</alternateName>
<alternateName lang="eo">Sudameriko</alternateName>
<alternateName lang="es">Sudamérica</alternateName>