private static bool ResetAttributePosition(XmlAttribute attribute, XmlAttributeCollection attributes, out int index) {
if (attributes != null) {
for (int i = 0; i < attributes.Count; i++) {
if (attribute == attributes[i]) {
index = i;
return true;
}
}
}
index = 0;
return false;
}