Can we refactor this loop into a helper method
```java
private String findRootTag(XmlResourceParser parser) { ... }
```
And then add validation for the root element to all of the following added XML types?