This is one of those things that you read once, say \"aha!\" and then forget. Exactly my case.
Why is the line-break tag in xhtml preferentially written with a space
w3c specifies this as the grammar:
EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
That means open bracket, a name, a number of (space and attribute) tokens, an optional space, a slash, and an end tag. According to this, both are correct.