refer to XML attributes using attr(NAME), not attributes[INDEX]