I'm wanting to select some DOM elements using jQuery, modify some attributes, and then write the DOM elements back out as xhtml snippets for post processing. I want the resulting xHTML to have only the attributes specified in the original page html plus the modifications I make with jQuery.
Is there an existing javascript library or API that can help me accomplish this task?