public void beginTag(String name) {
        if (!XML.isName(name)) {
            throw new IllegalArgumentException("The name '" + name
                    + "' cannot be used as an XML tag name. Legal names must adhere to"
                    + "http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-common-syn");
        }
        if (cachedTag != null) flush(false);
        cachedTag = name;
    }
Add a new XML tag with the given name.

@param name the tag name
document/src/main/java/com/yahoo/document/serialization/XmlStream.java