was getting errors when using the local variables. Switching to fully qualified names instead, which works fine even in XHTML documents.