/*
 * An XML document type.
 * Localname: root
 * Namespace: http://www.w3.org/1999/xlink
 * Java type: org.w3.x1999.xlink.RootDocument
 *
 * Automatically generated - do not modify.
 */
package org.w3.x1999.xlink.impl;
/**
 * A document containing one root(@http://www.w3.org/1999/xlink) element.
 *
 * This is a complex type.
 */
public class RootDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.w3.x1999.xlink.RootDocument
{
    
    public RootDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ROOT$0 = 
        new javax.xml.namespace.QName("http://www.w3.org/1999/xlink", "root");
    
    
    /**
     * Gets the "root" element
     */
    public org.apache.xmlbeans.XmlObject getRoot()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(ROOT$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "root" element
     */
    public void setRoot(org.apache.xmlbeans.XmlObject root)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(ROOT$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(ROOT$0);
            }
            target.set(root);
        }
    }
    
    /**
     * Appends and returns a new empty "root" element
     */
    public org.apache.xmlbeans.XmlObject addNewRoot()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(ROOT$0);
            return target;
        }
    }
}
