Sub Handle(req As ServletRequest, resp As ServletResponse)
mreq = req
mresp = resp
resp.ContentType = "text/html"
Subs.RespWriteStyle(resp)
'Dim DeviceC As ResultSet = Main.EnergyDB.ExecQuery("SELECT E3Status FROM Device")
Dim xb As XMLBuilder
xb = xb.create("CONTROLLER")
xb = xb.e("NAME").text("Collator").up
xb = xb.e("TYPENAME").text("Light Controller").up
xb = xb.e("TYPENUM").text("57376").up
xb = xb.e("ID").text("0988").up
xb = xb.e("VER").text("MERCM04").up
xb = xb.e("TIME").text("17:06:12 17/04/02").up
xb = xb.e("ALARMMASK").text("0x0260").up
xb = xb.e("IO")
xb = xb.e("INPUTS")
xb = xb.e("STR").attribute("ID", "PIRACT").attribute("NAME","PIR Activity").attribute("VALS", "Yes | No").text("Yes").up
xb = xb.e("STR").attribute("ID", "PIRSENSIN").attribute("NAME","PIR Sensing").attribute("VALS", "Yes | No").text("Yes").up
xb = xb.e("FP").attribute("ID", "LAMPLEV").attribute("NAME","Lamp Level").attribute("MIN", "0.0").attribute("MAX", "255.0").attribute("STEP", "1.0").text("N/A").up
xb = xb.e("STR").attribute("ID", "E3 STAT").attribute("NAME", "E3 Status").attribute("VALS", "System Ok | Function Test | Duration Test | Battery fault | Lamp Fault | Charging Failure | Inhibit Mode").text("N/A").up
xb = xb.up
xb = xb.e("OUTPUTS").up
xb = xb.e("STATES").up
xb = xb.e("COMMANDS").up
xb = xb.up
xb = xb.up
xb = xb.up
Dim props As Map
props.Initialize
props.Put("standalone", "Yes")
props.Put("{http://xml.apache.org/xslt}indent-amount", "4")
props.Put("indent", "yes")
'resp.Write("Hello World")
resp.Write(xb.asString2(props))