001    /**
002     * Implements the Cold Fusion Function xmlnew
003     */
004    package railo.runtime.functions.xml;
005    
006    import org.w3c.dom.Node;
007    
008    import railo.runtime.PageContext;
009    import railo.runtime.exp.PageException;
010    import railo.runtime.ext.function.Function;
011    import railo.runtime.op.Caster;
012    import railo.runtime.text.xml.XMLCaster;
013    import railo.runtime.text.xml.XMLUtil;
014    
015    public final class XmlNew implements Function {
016            public static Node call(PageContext pc) throws PageException {
017                    return call(pc,false);
018            }
019            public static Node call(PageContext pc, boolean caseSensitive) throws PageException {
020                    try {
021                            return XMLCaster.toXMLStruct(XMLUtil.newDocument(),caseSensitive);
022                    } 
023                    catch (Exception e) {
024                            throw Caster.toPageException(e);
025                    }
026            }
027            
028    }