code for XML attribute parser