I am trying to do this using lxml, but utlimately it is a question about the proper xpath.I'd like to select from the \[code\]<pgBreak>\[/code\] element until the end of its parent, in this case \[code\]<p\[/code\]>XML IN:\[code\] <root> <pgBreak pgId="1"/> <p> some text to fill out a para <pgBreak pgId="2"/> some more text <quote> A quoted block </quote> remainder of para </p> </root>\[/code\]XML OUT:\[code\] <root> <pgBreak pgId="1"/> <p> some text to fill out a para </p> <pgBreak pgId="2"/> <p> some more text <quote> A quoted block </quote> remainder of para </p> </root>\[/code\]