add site language to XML i'm trying to get a extra element in our XML that show the site langues where te customer is working in. However i can not get is to work....

Here is the code:

if ($submission-&gt;nid == 315) {
$destination['path'] = 'private://export/account/';
$destination['filename'] = 'request_password_' . $submission-&gt;sid . '.xml';
$wrapper = 'request_password';

// when content is supplied, generate XML file
if (isset($destination['path'], $destination['filename'], $wrapper)) {
$source = array();
$source['data'] = $submission-&gt;data;
$source['node'] = $node-&gt;webform['components'];

$xml = new XmlWebformGenerate();
$xml-&gt;setXmlHeader('1.0', 'utf-8');
$xml-&gt;setXmlWrapper($wrapper);
$xml-&gt;source = (new XmlSource($source))-&gt;getSource();


What this does is; create a XML from a webform. 
When the user submit the webform then it will create a XML file with te field of the webform. However what i would like to add is a  tag that displays the language the user is viewing. however i cannot find a way to insert it to the XML, because it's already receiving the source from the node.

Could some one help me out with this? Many thanks! :)
You can get the current language through the global $language var:

$current_lang_code = $GLOBALS['language']-&gt;language;


With that in mind you just need to make whatever changes are necessary to your PHP classes (XmlWebformGenerate/XmlSource/etc), to add that data to the document.