It sounds as if now is a good time to familiarize yourself with one of these modules.
In reply to Re^3: Getting start and end xml tags by Corion in thread Getting start and end xml tags by corfuitl