Add factory method to allow recursive scans for different types

Used for e.g. embeddded css/javascript in html