Seems to easy to load xml/xhtml source into a DOM object, pick a section root, build an iterator of certain tags within the section and clear or modify attributes or delete other tags altogether and associate the content with the parent tag….until you start writing the code.