public function language(DOMElement $el)
	{
		// element has a lang attribute; use it
		if ($el->hasAttribute('lang')) {
			return unicodeTrim($el->getAttribute('lang'));
		}

		if ($el->tagName == 'html') {
			// we're at the <html> element and no lang; check <meta> http-equiv Content-Language
			foreach ( $this->xpath->query('.//meta[@http-equiv]') as $node )
			{
				if ($node->hasAttribute('http-equiv') && $node->hasAttribute('content') && strtolower($node->getAttribute('http-equiv')) == 'content-language') {
					return unicodeTrim($node->getAttribute('content'));
				}
			}
		} elseif ($el->parentNode instanceof DOMElement) {
			// check the parent node
			return $this->language($el->parentNode);
		}

		return '';
	}