A comment can only appear before or after the start tag (regardless of whether it is an empty tag).
A comment may not appear within the start-tag of an XML element:
[40] STag ::= '<' Name (S Attribute)* S? '>'
Nor may a comment appear within an end-tag:
[44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
In general, per section 2.5 Comments:
[Definition: Comments may appear anywhere in a document outside
other markup; in addition, they may appear within the document
type declaration at places allowed by the grammar. ...]
Here is one way to document element attributes:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView_ben"
android:layout_centerHorizontal="true"/>
<!--
android:id="@+id/textView_ben"
addresses defect #123
android:layout_centerHorizontal="true"
blah blah blah -->
Alternatively, such a comment may appear before the tag; it just cannot appear within a tag.