<xsp:logic>
Date date = new Date();
</xsp:logic>"xsp:logic" elements enclose Java code. They should not enclose elements for the result.

It best to keep the <xsp:logic> and </xsp:logic> lines at the beginning of the line without any indentation. They are more structural than part of the code, and indenting them with the code is difficult to maintain as the code changes, useless because they do not define code blocks, and detrimental because it is much less obvious if a line is inside or outside a logic section.

<date><xsp:expr>date</xsp:expr></date>Add elements to the result.
"xsp:expr" elements enclose simple Java expressions. They are typically a variable name, but they can include a function like "date.toString()".