Is there a way to read an entire XML file into a Python variable with tags and indentation?
data = """<?xml version="1.0" encoding="UTF-8" ?>
<uimap>
<page name="login">
<uielement name="username">
<locator>//input[@type='text']</locator>
</uielement>
<uielement name="password">
<locator>//input[@type='password']</locator>
</uielement>
</page>
</uimap>
"""
This was a short example so I could manually type it in but if my XML files are really big, how can I read them into a python variable? Using fopen is not an option because it is reading all font size and styles too which is redundant in my case.