The DOM interface has been given a method that returns the language for
  a given node. The language is returned as a string (on whatever format is
  used in the XML document - should be iso), and may be null if no language is
  defined.
  |  |  |  | 
|  | 
    public String DOM.getLanguage(int node);
   |  | 
|  |  |  | 
The BasisLibrary class has a static method that will compare the language
  of the context node with some other language and return the result as a
  boolean.
  |  |  |  | 
|  | 
    public static boolean BasisLibrary.testLanguage(String language, DOM dom, int node);
   |  | 
|  |  |  | 
The compiled code for the lang() method calls this method in the
  BasisLibrary and leaves the result on the stack for the calling element.