title: Read data from XML having nested inconsistent structure
body: <p>Source XML Data -</p>
  <pre><code>&lt;EntityType Name=&quot;WorkItem&quot;&gt;
     &lt;Property Name=&quot;WorkItemId&quot; Type=&quot;Edm.Int32&quot; Nullable=&quot;false&quot;&gt;
        &lt;Annotation Term=&quot;Ref.ReferenceName&quot; String=&quot;System.Id&quot; /&gt;
        &lt;Annotation Term=&quot;Display.DisplayName&quot; String=&quot;Work Item Id&quot; /&gt;
     &lt;/Property&gt;
     &lt;Property Name=&quot;InProgressDate&quot; Type=&quot;Edm.DateTimeOffset&quot;&gt;
        &lt;Annotation Term=&quot;Display.DisplayName&quot; String=&quot;InProgress Date&quot; /&gt;
     &lt;/Property&gt;
     &lt;Property Name=&quot;InProgressDateSK&quot; Type=&quot;Edm.Int32&quot; /&gt;
     &lt;Property Name=&quot;CompletedDateSK&quot; Type=&quot;Edm.Int32&quot; /&gt;
  &lt;/EntityType&gt;
  </code></pre>
  <p>Required output something like below or at least in column format. Its ok if the output is not in exact below format with headers as shown but looking for help in tweaking the code to get result in column format</p>
  <p><a href="https://i.stack.imgur.com/2pTP1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2pTP1.png" alt="enter image description here" /></a></p>
  <p>What I tried -</p>
  <pre><code>Select-Xml -Path D:\Temp\meta.xml -XPath '/EntityType/Property' | ForEach-Object { $_.Node.Name, $_.Node.Type, $_.node.Annotation } 
  </code></pre>
  <p>also</p>
  <pre><code>Select-Xml -Path D:\Temp\meta.xml -XPath '/EntityType/Property' | select -ExpandProperty Node
  </code></pre>