I have this code:
linenum = 1
for g in u.answers:
attr = ""
lines.append("\t\t<answer%s>%s</answer>" % (attr, g[0]))
linenum += 1
which results in:
<xml>
<answer>Primary Job Function</answer>
<answer>Engineering</answer>
<answer>Size of Company</answer>
<answer>100</answer>
<answer>Job Level</answer>
<answer>Manager</answer>
<answer>Type of Company</answer>
<answer>Supplier</answer>
<xml>
Would like to increment and get the following result:
<xml>
<question1>Primary Job Function</question1>
<answer1>Engineering</answer1>
<question2>Size of Company</question2>
<answer2>100</answer2>
<question3>Job Level</question3>
<answer3>Manager</answer3>
<question4>Type of Company</question4>
<answer4>Supplier</answer4>
</xml>