How to hide XML tag attributes or lock XML tag attributes

Like what:
1:data1 hide attributes
2:data1 lock attributes Cannot be modified