You would only have to do two checks if you didn't know what you were looking for. Otherwise, you simply search for what matters ... regardless of position.
If a meta tag with the name "xyz" is what you need to find, then you use a regex that doesn't care in what order the name attribute appears:
Code:
<meta[^>]*(?=name=\"xyz\")[^>]*>
If it's the content attribute that you're looking to match, then its:
Code:
<meta[^>]*(?=content=\"123\")[^>]*>
Not trying to discourage you from using bs4/lxml for pure xml, just trying to point out that unless you've got a lot of complicated metadata editing to do, a simple find and replace could turn out to be much simpler and use less lines of code.