I have code that for all intents and purposes follows the following format for a bunch of users. I need to be able to extract just the email part of the XML in Powershell. How would I do that? The indentation is messed up, I know and am sorry.
<user>
<primary_id>jd112</primary_id>
<first_name>John</first_name>
<middle_name/>
<last_name>Doe</last_name>
<full_name>John Doe</full_name>
-<contact_info>
-<addresses>
-<emails>
<email_address>john.doe@main.com</email_address>
</email>
</emails>
</addresses>
</contact_info>
</user>