add site language to XML
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.