public static DumpData toDumpData(Node node, PageContext pageContext, int maxlevel, DumpProperties props) {
	if (maxlevel <= 0) {
	    return DumpUtil.MAX_LEVEL_REACHED;
	}
	maxlevel--;
	// Document
	if (node instanceof Document) {
	    DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
	    table.setTitle("XML Document");
	    table.appendRow(1, new SimpleDumpData("XmlComment"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCOMMENT, null).toString()));
	    table.appendRow(1, new SimpleDumpData("XmlRoot"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLROOT, null), pageContext, maxlevel, props));
	    return table;

	}
	// Element
	if (node instanceof Element) {
	    DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
	    table.setTitle("XML Element");
	    table.appendRow(1, new SimpleDumpData("xmlName"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNAME, null).toString()));
	    table.appendRow(1, new SimpleDumpData("XmlNsPrefix"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSPREFIX, null).toString()));
	    table.appendRow(1, new SimpleDumpData("XmlNsURI"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSURI, null).toString()));
	    table.appendRow(1, new SimpleDumpData("XmlText"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLTEXT, null), pageContext, maxlevel, props));
	    table.appendRow(1, new SimpleDumpData("XmlComment"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCOMMENT, null).toString()));
	    table.appendRow(1, new SimpleDumpData("XmlAttributes"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLATTRIBUTES, null), pageContext, maxlevel, props));
	    table.appendRow(1, new SimpleDumpData("XmlChildren"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCHILDREN, null), pageContext, maxlevel, props));
	    return table;

	}
	// Text
	if (node instanceof Text) {
	    DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
	    table.setTitle("XML Text");
	    Text txt = (Text) node;

	    table.appendRow(1, new SimpleDumpData("XmlText"), new SimpleDumpData(txt.getData()));
	    return table;

	}
	// Attr
	if (node instanceof Attr) {
	    DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
	    table.setTitle("XML Attr");
	    table.appendRow(1, new SimpleDumpData("xmlName"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNAME, null).toString()));
	    table.appendRow(1, new SimpleDumpData("XmlValue"), DumpUtil.toDumpData(((Attr) node).getValue(), pageContext, maxlevel, props));
	    table.appendRow(1, new SimpleDumpData("XmlType"), new SimpleDumpData(XMLUtil.getTypeAsString(node, true)));

	    return table;

	}
	// Node
	DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
	table.setTitle("XML Node (" + ListUtil.last(node.getClass().getName(), ".", true) + ")");
	table.appendRow(1, new SimpleDumpData("xmlName"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNAME, null).toString()));
	table.appendRow(1, new SimpleDumpData("XmlNsPrefix"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSPREFIX, null).toString()));
	table.appendRow(1, new SimpleDumpData("XmlNsURI"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSURI, null).toString()));
	table.appendRow(1, new SimpleDumpData("XmlText"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLTEXT, null), pageContext, maxlevel, props));
	table.appendRow(1, new SimpleDumpData("XmlComment"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCOMMENT, null).toString()));
	table.appendRow(1, new SimpleDumpData("XmlAttributes"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLATTRIBUTES, null), pageContext, maxlevel, props));
	table.appendRow(1, new SimpleDumpData("XmlChildren"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCHILDREN, null), pageContext, maxlevel, props));

	table.appendRow(1, new SimpleDumpData("XmlType"), new SimpleDumpData(XMLUtil.getTypeAsString(node, true)));

	return table;
    }
public static DumpData toDumpData ( Node node , PageContext pageContext , int maxlevel , DumpProperties props ) { if ( maxlevel <= 0 ) { return DumpUtil . MAX_LEVEL_REACHED ; } maxlevel -- ; if ( node instanceof Document ) { DumpTable table = new DumpTable ( "xml" , "#cc9999" , "#ffffff" , "#000000" ) ; table . setTitle ( "XML Document" ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlComment" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLCOMMENT , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlRoot" ) , DumpUtil . toDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLROOT , null ) , pageContext , maxlevel , props ) ) ; return table ; } if ( node instanceof Element ) { DumpTable table = new DumpTable ( "xml" , "#cc9999" , "#ffffff" , "#000000" ) ; table . setTitle ( "XML Element" ) ; table . appendRow ( 1 , new SimpleDumpData ( "xmlName" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLNAME , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlNsPrefix" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLNSPREFIX , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlNsURI" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLNSURI , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlText" ) , DumpUtil . toDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLTEXT , null ) , pageContext , maxlevel , props ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlComment" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLCOMMENT , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlAttributes" ) , DumpUtil . toDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLATTRIBUTES , null ) , pageContext , maxlevel , props ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlChildren" ) , DumpUtil . toDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLCHILDREN , null ) , pageContext , maxlevel , props ) ) ; return table ; } if ( node instanceof Text ) { DumpTable table = new DumpTable ( "xml" , "#cc9999" , "#ffffff" , "#000000" ) ; table . setTitle ( "XML Text" ) ; Text txt = ( Text ) node ; table . appendRow ( 1 , new SimpleDumpData ( "XmlText" ) , new SimpleDumpData ( txt . getData ( ) ) ) ; return table ; } if ( node instanceof Attr ) { DumpTable table = new DumpTable ( "xml" , "#cc9999" , "#ffffff" , "#000000" ) ; table . setTitle ( "XML Attr" ) ; table . appendRow ( 1 , new SimpleDumpData ( "xmlName" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLNAME , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlValue" ) , DumpUtil . toDumpData ( ( ( Attr ) node ) . getValue ( ) , pageContext , maxlevel , props ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlType" ) , new SimpleDumpData ( XMLUtil . getTypeAsString ( node , true ) ) ) ; return table ; } DumpTable table = new DumpTable ( "xml" , "#cc9999" , "#ffffff" , "#000000" ) ; table . setTitle ( "XML Node (" + ListUtil . last ( node . getClass ( ) . getName ( ) , "." , true ) + ")" ) ; table . appendRow ( 1 , new SimpleDumpData ( "xmlName" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLNAME , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlNsPrefix" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLNSPREFIX , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlNsURI" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLNSURI , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlText" ) , DumpUtil . toDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLTEXT , null ) , pageContext , maxlevel , props ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlComment" ) , new SimpleDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLCOMMENT , null ) . toString ( ) ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlAttributes" ) , DumpUtil . toDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLATTRIBUTES , null ) , pageContext , maxlevel , props ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlChildren" ) , DumpUtil . toDumpData ( XMLUtil . getProperty ( node , XMLUtil . XMLCHILDREN , null ) , pageContext , maxlevel , props ) ) ; table . appendRow ( 1 , new SimpleDumpData ( "XmlType" ) , new SimpleDumpData ( XMLUtil . getTypeAsString ( node , true ) ) ) ; return table ; }
Casts a XML Node to a HTML Presentation

@param node
@param pageContext
@return html output