protected I_CmsXmlDocument toXml(Object input) throws CmsException {

        if (input instanceof CmsJspContentAccessBean) {
            return ((CmsJspContentAccessBean)input).getRawContent();
        }
        if (input instanceof I_CmsXmlDocument) {
            return (I_CmsXmlDocument)input;
        } else {
            CmsResource res = toResource(input);
            return CmsXmlContentFactory.unmarshal(getCmsObject(), getCmsObject().readFile(res));
        }
    }
protected I_CmsXmlDocument toXml ( Object input ) throws CmsException { if ( input instanceof CmsJspContentAccessBean ) { return ( ( CmsJspContentAccessBean ) input ) . getRawContent ( ) ; } if ( input instanceof I_CmsXmlDocument ) { return ( I_CmsXmlDocument ) input ; } else { CmsResource res = toResource ( input ) ; return CmsXmlContentFactory . unmarshal ( getCmsObject ( ) , getCmsObject ( ) . readFile ( res ) ) ; } }
Converts the input (typically a specification of an XML file) to an XML document.

If the input already is an XML document, it is returned.
Otherwise the method assumes the input specifies an XML file
and tries to determine and unmarshal that file.nd unmarshal that file

To determine the file {@link #toResource(Object)} is used.

@param input the object to be converted to an XML document.
@return the XML document specified by the input.
@throws CmsException if converting the input to a XML document fails.