How to remove all except some DOM elements in JQuery?
<p>I would like to remove all hidden elements in a piece of the DOM, but preserving all (included hidden items) under certain class.</p>

<p>Here you have a (non) <a href="http://jsfiddle.net/navi2000/VWZ6B/1/" rel="nofollow">working example</a>:</p>

<pre><code>&lt;div id="init"&gt;
    &lt;input type="hidden" name="x" value="y" /&gt;
    &lt;ul&gt;
        &lt;li&gt;Hello&lt;/li&gt;
        &lt;li&gt;Bye&lt;/li&gt;
        &lt;li class="block"&gt;
            &lt;ol&gt;
                &lt;li&gt;First&lt;/li&gt;
                &lt;li&gt;Second&lt;/li&gt;
                &lt;li&gt;Third&lt;/li&gt;
            &lt;/ol&gt;
        &lt;/li&gt;
        &lt;li&gt;Test&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>CSS: <code>li { "display:none" }</code></p>

<p>So, I'm looking for the selector that removes all hidden items except those that have a <em>block</em> class or are under a <em>block</em> class. In this case the expected result is:</p>

<pre><code>&lt;div id="init"&gt;
    &lt;ul&gt;
        &lt;li class="block"&gt;
            &lt;ol&gt;
                &lt;li&gt;First&lt;/li&gt;
                &lt;li&gt;Second&lt;/li&gt;
                &lt;li&gt;Third&lt;/li&gt;
            &lt;/ol&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>I've been playing with :not operator, but no success.</p>
