// Query html $x('//textarea[@id="source"]') // Query xml $xml = $.parseXML($('#source').val()) $x('//item[@group="true"]', $xml)