Updated for XML generation