Returns the root element to be marshalled as XML

@return
183546
public Object marshalRootElement() {
        if (justRoutes) {
            RoutesDefinition routes = new RoutesDefinition();
            routes.setRoutes(contextElement.getRoutes());
            return routes;
        } else {
            return contextElement;
        }
    }
1289384
public IntList getRoots() {
    IntList roots = new IntArrayList();
    for(int i = 0; i < used; i++) {
      // roots or one element in component
      if(parent[i] == i) {
        roots.add(i);
      }
    }
    return roots;
  }
1200717
public static String getText(final Node root) {
        if (root == null) {
            return "";
        } else {
            final StringBuilder result = new StringBuilder(1024);
            if (root.hasChildNodes()) {
                final NodeList list = root.getChildNodes();
                for (int i = 0; i < list.getLength(); i++) {
                    final Node childNode = list.item(i);
                    if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                        final Element e = (Element) childNode;
                        final String value = e.getAttribute(ATTRIBUTE_NAME_CLASS);
                        if (!excludeList.contains(value)) {
                            final String s = getText(e);
                            result.append(s);
                        }
                    } else if (childNode.getNodeType() == Node.TEXT_NODE) {
                        result.append(childNode.getNodeValue());
                    }
                }
            } else if (root.getNodeType() == Node.TEXT_NODE) {
                result.append(root.getNodeValue());
            }
            return result.toString();
        }
    }
956067
@Override
  protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {

    // Find out if the our namespace already has been defined, and if so, get the prefix.
    //
    final String namespace = CurrentAddressType.TYPE_NAME.getNamespaceURI();
    String prefix = CurrentAddressType.TYPE_NAME.getPrefix();
    for (Namespace ns : xmlObject.getNamespaceManager().getNamespaces()) {
      if (namespace.equals(ns.getNamespaceURI())) {
        prefix = ns.getNamespacePrefix();
        break;
      }
    }    
    StringBuilder sb = new StringBuilder();

    final List<XMLObject> childXMLObjects = xmlObject.getOrderedChildren();
    if (childXMLObjects != null && childXMLObjects.size() > 0) {
      for (final XMLObject childXMLObject : childXMLObjects) {
        if (childXMLObject == null) {
          continue;
        }
        if (!(childXMLObject instanceof XSString)) {
          throw new MarshallingException("Unexpected type of child element - " + childXMLObject.getClass().getName());
        }
        XSString childString = (XSString) childXMLObject;
        if (childString.getValue() == null) {
          continue;
        }
        String localPart = childString.getElementQName().getLocalPart();
        sb.append(String.format("<%s:%s>%s</%s:%s>", prefix, localPart, childString.getValue(), prefix, localPart));
      }
    }
    if (sb.length() > 0) {
      byte[] bytes;
      try {
        bytes = sb.toString().getBytes("UTF-8");
      }
      catch (UnsupportedEncodingException e) {
        throw new MarshallingException(e);
      }
      String base64String = Base64.encodeBytes(bytes, Base64.NO_OPTIONS); 
      XMLHelper.appendTextContent(domElement, base64String);
    }
  }
1253888
public Class<? extends ElementBase> getRootClass() {
        LayoutElement top = root == null ? null : root.getChild(LayoutElement.class);
        return top == null ? null : top.getDefinition().getClazz();
    }
754710
private Element getRootElement(String fileName) throws
      IOException, SAXException, ParserConfigurationException {
    DocumentBuilderFactory docBuilderFactory =
      DocumentBuilderFactory.newInstance();
    docBuilderFactory.setIgnoringComments(true);
    DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
    Document doc = builder.parse(new File(fileName));
    Element root = doc.getDocumentElement();
    if (!matched(root, CONFIGURATION_TAG_NAME)) {
      throw new IOException("Bad " + fileName);
    }
    return root;
  }
802587
@Override
    public String getRootFolderId() {
        if (rootNodeId == null) {
            Document layout = getUserLayoutDOM();

            Element rootNode =
                    this.xpathOperations.evaluate("//layout/folder", layout, XPathConstants.NODE);
            if (rootNode == null
                    || !rootNode.getAttribute(Constants.ATT_TYPE)
                            .equals(Constants.ROOT_FOLDER_ID)) {
                LOG.error(
                        "Unable to locate root node in layout of "
                                + owner.getUserName()
                                + ". Resetting corrupted layout.");
                resetLayout((String) null);

                rootNode =
                        this.xpathOperations.evaluate(
                                "//layout/folder", layout, XPathConstants.NODE);
                if (rootNode == null
                        || !rootNode.getAttribute(Constants.ATT_TYPE)
                                .equals(Constants.ROOT_FOLDER_ID)) {
                    throw new PortalException(
                            "Corrupted layout detected for "
                                    + owner.getUserName()
                                    + " and resetting layout failed.");
                }
            }
            rootNodeId = rootNode.getAttribute("ID");
        }
        return rootNodeId;
    }
314262
private String getRootNode() {

        CmsResource resource = null;
        String title = null;
        String folder = getRootFolder();
        try {
            resource = getCms().readFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION);
            // get the title information of the folder
            CmsProperty titleProperty = getCms().readPropertyObject(
                folder,
                CmsPropertyDefinition.PROPERTY_TITLE,
                false);

            if ((titleProperty == null) || titleProperty.isNullProperty()) {
                getCms().getSitePath(resource);
                title = resource.getRootPath();
            } else {
                title = titleProperty.getValue();
            }
            return getNode(resource.getRootPath(), title, resource.getTypeId(), true, resource.getState(), false);
        } catch (CmsException e) {
            // should usually never happen
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
        }
        return "";
    }
48763
private String getCore() {

        try {
            return parseMandatoryStringValue(XML_ELEMENT_CORE);
        } catch (final Exception e) {
            LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_CORE_SPECIFIED_0), e);
            return null;
        }
    }
429429
public String getXML()
    {
        Object root = null;
        if (m_message != null)
            root = m_message.getRawData();
        if (root != null)
        {
            try {
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                String strSOAPPackage = (String)((TrxMessageHeader)this.getMessage().getMessageHeader()).get(SOAPMessageTransport.SOAP_PACKAGE);
    
                Marshaller m = JaxbContexts.getJAXBContexts().getMarshaller(strSOAPPackage);
                if (m == null)
                    return null;
                synchronized(m)
                {   // Since the marshaller is shared (may want to tweek this for multi-cpu implementations)
                    m.marshal( root, out );
                }
                String strXML = out.toString(Constants.STRING_ENCODING);
                return strXML;
            } catch (IOException ex)  {
                ex.printStackTrace();   // Never
            } catch (JAXBException ex)   {
                ex.printStackTrace();
            } catch (java.lang.IllegalArgumentException ex)   {
                ex.printStackTrace();
            }
        }
        return null;
    }
160375
public AstRoot getAstRoot() {
        AstNode parent = this;  // this node could be the AstRoot
        while (parent != null && !(parent instanceof AstRoot)) {
            parent = parent.getParent();
        }
        return (AstRoot)parent;
    }
568956
private Element getXHELMRootElement(String resource) throws JDOMException, IOException {

		ByteArrayInputStream stream = new ByteArrayInputStream(resource.getBytes());
		SAXBuilder builder = new SAXBuilder();
		Document doc = builder.build(stream);

		return doc.getRootElement();
	}
257052
public String toXml() {
        
        StringWriter writer = new StringWriter();
        JAXB.marshal(this, writer);
        writer.flush();
        
        return writer.toString();
        
    }
477105
public XMLString xstr()
  {
    if(null == m_xmlStr)
      m_xmlStr = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot);
    
    return m_xmlStr;
  }
1185100
public Element endElementBuilder() {
        final Element element = (Element) this.configurationStack.removeLast();
        if ( this.characters != null ) {
            element.appendChild( this.document.createTextNode( this.characters.toString() ) );
        }

        this.characters = null;

        return element;
    }
1112759
public Node getNode() {
        if (node == null) {
            if (resource != null) {
                node = resource.adaptTo(Node.class);
            }
        }
        return node;
    }
540727
def xml(self):
        
        root = Element('Security', ns=wssens)
        root.set('mustUnderstand', str(self.mustUnderstand).lower())
        for t in self.tokens:
            root.append(t.xml())
        return root