This way we make sure that it's valid even if the xml data is not. BUG: 327663 (cherry picked from commit 442e44a1)