Столкнулся с проблемой парсинга сложных XML структур. Как обрабатывать простые структуры - понятно. Но со сложными уже проблема. Не до конца понимаю как вытянуть с документа те данные, которые мне нужны. XML вида:
<queryresult success="true" error="false" numpods="4" datatypes="Solve" timedout="" timedoutpods="" timing="1.34" parsetiming="0.384" parsetimedout="false" recalculate="" id="MSP69710g91h922a621313000046dceadc3c3e98g8" host="https://www5a.wolframalpha.com" server="56" related="https://www5a.wolframalpha.com/api/v1/relatedQueries.jsp?id=MSPa69810g91h922a621313000010h49ie4i44c2g681335321721000003642" version="2.6">
<pod title="Input interpretation" scanner="Identity" id="Input" position="100" error="false" numsubpods="1">
<subpod title="">
<plaintext>solve sin(x) - 1 = 0</plaintext>
</subpod>
<expressiontypes count="1">
<expressiontype name="Default"/>
</expressiontypes>
</pod>
<pod title="Results" scanner="Solve" id="Result" position="200" error="false" numsubpods="2" primary="true">
<subpod title="">
<plaintext>x = 1/2 (4 π n + π) and n element Z</plaintext>
</subpod>
<subpod title="Possible intermediate steps">
<plaintext>
Solve for x: sin(x) - 1 = 0 Add 1 to both sides: sin(x) = 1 Take the inverse sine of both sides: Answer: | | x = 2 π n + π/2 for n element Z
</plaintext>
<infos count="1">
<info text="Z is the set of integers">
<link url="http://reference.wolfram.com/language/ref/Integers.html" text="Documentation" title="Documentation"/>
<link url="http://mathworld.wolfram.com/Z.html" text="Definition" title="MathWorld"/>
</info>
</infos>
</subpod>
<expressiontypes count="2">
<expressiontype name="Default"/>
<expressiontype name="Default"/>
</expressiontypes>
<states count="2">
<state name="Approximate form" input="Result__Approximate form"/>
<state name="Hide steps" input="Result__Hide steps"/>
</states>
</pod>
<pod title="Root plot" scanner="Solve" id="RootPlot" position="300" error="false" numsubpods="1">
<subpod title="">
<plaintext/>
</subpod>
<expressiontypes count="1">
<expressiontype name="Default"/>
</expressiontypes>
</pod>
<pod title="Number line" scanner="Solve" id="NumberLine" position="400" error="false" numsubpods="1">
<subpod title="">
<plaintext/>
</subpod>
<expressiontypes count="1">
<expressiontype name="Default"/>
</expressiontypes>
</pod>
</queryresult>
Kак получить текст изо всех атрибутов plaintext
и поместить их в строку?