code: Locale getLocale(TransformerImpl transformer, int contextNode)
            throws TransformerException
    {
  
      Locale locale = null;
  
      if (null != m_lang_avt)
      {
        XPathContext xctxt = transformer.getXPathContext();
        String langValue = m_lang_avt.evaluate(xctxt, contextNode, this);
  
        if (null != langValue)
        {
  
          // Not really sure what to do about the country code, so I use the
          // default from the system.
          // TODO: fix xml:lang handling.
          locale = new Locale(langValue.toUpperCase(), "");
  
          //Locale.getDefault().getDisplayCountry());
          if (null == locale)
          {
            transformer.getMsgMgr().warn(this, null, xctxt.getDTM(contextNode).getNode(contextNode),
                                         XSLTErrorResources.WG_LOCALE_NOT_FOUND,
                                         new Object[]{ langValue });  //"Warning: Could not find locale for xml:lang="+langValue);
  
            locale = Locale.getDefault();
          }
        }
      }
      else
      {
        locale = Locale.getDefault();
      }
  
      return locale;
    }
docs: Get the locale we should be using.
  
  @param transformer non-null reference to the the current transform-time state.
  @param contextNode The node that "." expresses.
  
  @return The locale to use. May be specified by "lang" attribute,
  but if not, use default locale on the system.
  
  @throws TransformerException