If your problem is with the Python SDK as well, there are a few gotchas you need to be aware of. First, you must XML escape the next-tag value before executing the next iteration. Second, if you're reusing the same NaElement API object to execute the next iteration, you must update the value of the tag NaElement using the NaElement.set_content() method on the third and subsequent iterations, as calling api.child_add_string("tag", next_tag) a second time will append a new copy of the tag child object under the API object rather than updating the value of the existing tag object.
See if the abbreviated code example below gets you going. If you're still running into problems, please post some more details and a short code example so we can help further.