code: public void addValue(String name, Locale locale) throws CmsIllegalArgumentException {
  
          if (name.indexOf('[') >= 0) {
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.ERR_XML_PAGE_CONTAINS_INDEX_1, name));
          }
  
          if (hasValue(name, locale)) {
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.ERR_XML_PAGE_LANG_ELEM_EXISTS_2, name, locale));
          }
  
          Element pages = m_document.getRootElement();
          String localeStr = locale.toString();
          Element page = null;
  
          // search if a page for the selected language is already available
          for (Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(pages, NODE_PAGE); i.hasNext();) {
              Element nextPage = i.next();
              String language = nextPage.attributeValue(ATTRIBUTE_LANGUAGE);
              if (localeStr.equals(language)) {
                  // a page for the selected language was found
                  page = nextPage;
                  break;
              }
          }
  
          // create the new element
          Element element;
          if (page != null) {
              // page for selected language already available
              element = page.addElement(NODE_ELEMENT).addAttribute(ATTRIBUTE_NAME, name);
          } else {
              // no page for the selected language was found
              element = pages.addElement(NODE_PAGE).addAttribute(ATTRIBUTE_LANGUAGE, localeStr);
              element = element.addElement(NODE_ELEMENT).addAttribute(ATTRIBUTE_NAME, name);
          }
  
          // add empty nodes for link table and content to the element
          element.addElement(NODE_LINKS);
          element.addElement(NODE_CONTENT);
  
          CmsXmlHtmlValue value = new CmsXmlHtmlValue(this, element, locale);
  
          // bookmark the element
          addBookmark(CmsXmlUtils.createXpathElement(name, 1), locale, true, value);
      }
docs: Adds a new, empty value with the given name and locale
  to this XML document.<p>
  
  @param name the name of the value
  @param locale the locale of the value
  
  @throws CmsIllegalArgumentException if the name contains an index ("[&lt;number&gt;]") or the value for the
  given locale already exists in the xmlpage.